body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #eef2fb, #e1e9ff);
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease;
}

header {
  background: linear-gradient(90deg, #6a5dfc, #5849e8);
  color: #ffffff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(90, 79, 207, 0.4);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  user-select: none;
}

header .logo {
  text-decoration: none;
  color: inherit;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 3rem auto;
  padding: 0 2rem;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 50, 0.1);
  transition: box-shadow 0.3s ease;
}

main:hover {
  box-shadow: 0 14px 35px rgba(0, 0, 50, 0.15);
}

main h1 {
  font-weight: 800;
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #333;
  user-select: none;
}

footer {
  background-color: #121212;
  color: #888;
  padding: 2rem 1rem;
  font-size: 1rem;
  text-align: center;
  user-select: none;
  border-top: 1px solid #222;
}

a {
  color: #7d79ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: #5248ff;
  text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
  header {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
  }

  main {
    margin: 1.5rem auto;
    padding: 1rem 1.5rem;
    border-radius: 12px;
  }

  main h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 400px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 1rem;
  }

  main {
    padding: 1rem;
    margin: 1rem auto;
  }
}

/* Поля ввода с плоским дизайном */
input[type="number"], select, input[type="date"], input[type="text"] {
  width: 100%;
  padding: 6px 0px;
  font-size: 1.7rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 0; /* Без скруглений */
  background-color: #fff;
  color: #222;
  transition: border-color 0.2s ease;
  font-family: 'Inter', sans-serif;
}

input[type="number"]:focus, select:focus, input[type="date"]:focus, input[type="text"]:focus {
  border-color: #5061f9;
  outline: none;
  background-color: #f0f2ff;
}

/* Кнопки с плоским стилем и отступами */
button, input[type="submit"], input[type="button"] {
  cursor: pointer;
  background-color: #5061f9;
  border: none;
  border-radius: 0; /* Без скруглений */
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 26px;
  margin-top: 12px;
  box-shadow: none;
  transition: background-color 0.25s ease;
  font-family: 'Inter', sans-serif;
  margin-bottom: 10px;
}

button:hover, button:focus, input[type="submit"]:hover, input[type="submit"]:focus,
input[type="button"]:hover, input[type="button"]:focus {
  background-color: #3949e0;
  outline: none;
}

/* Метки */
label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 1rem;
  color: #333;
  max-width: 360px;
  margin-bottom: 20px;
  word-break: break-word;
}

label > input,
label > select {
  margin-top: 6px;
  max-width: 100%;
  box-sizing: border-box;
}

/* Расположение формы — адаптивное */
.container form {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  justify-content: center;
}

@media (min-width: 768px) {
  .container form label {
    flex: 1 1 320px;
  }
}

@media (max-width: 767px) {
  .container form {
    flex-direction: column;
    gap: 18px 0;
  }
  .container form label {
    max-width: 100%;
  }
}
.ipotech-result {
  background-color: #f5f7ff; /* Светлый фон, сочетается с общим стилем */
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 20px 25px;
  margin-top: 30px;
  box-shadow: 0 6px 15px rgba(90, 79, 207, 0.1);
  color: #2c2c2c;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 2.6;
  max-width: 1000px;
  word-wrap: break-word;
  user-select: text;
  transition: box-shadow 0.3s ease;
}

.ipotech-result:hover {
  box-shadow: 0 8px 25px rgba(90, 79, 207, 0.2);
}

#result {
    margin-top: 20px;
    padding: 9px 15px;
    background-color: #f0f8ff;
    border: 1px solid #a0c8ff;
    border-radius: 1px;
    font-size: 1.8em;
    color: #003366;
    margin-bottom: 10px;
}

.calculator-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  justify-content: center;
}
.calculator-tile {
  flex: 1 1 200px;
  background-color: #f3f4f6;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  padding: 20px;
  font-weight: 600;
  font-size: 1.1em;
  color: #1a73e8;
  text-decoration: none;
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
}
.calculator-tile:hover,
.calculator-tile:focus {
  background-color: #e8f0fe;
  box-shadow: 0 4px 8px rgb(26 115 232 / 0.3);
  outline: none;
}
@media (max-width: 600px) {
  .calculator-tile {
    flex: 1 1 100%;
  }
}
.tiles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 10px;
  }

  .holiday-tile {
    background: #f0f8ff;
    border: 2px solid #007bff;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
    padding: 20px;
    width: 280px;
    text-align: center;
    color: #004085;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: transform 0.3s ease;
  }

  .holiday-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,123,255,0.4);
  }

  .holiday-name {
    font-weight: 700;
    font-size: 1.4em;
    margin-bottom: 10px;
  }

  .days-hours {
    font-size: 2.8em;
    font-weight: 800;
    color: #0056b3;
    margin-bottom: 5px;
    white-space: nowrap;
  }

  .days-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #007bff;
    margin-left: 5px;
  }

  .minutes-seconds {
    font-size: 1em;
    font-weight: 600;
    color: #007bff;
  }
  .calculator-container {
    max-width: 100%;
    margin: 1rem auto;
    padding: 1rem;
    background: #f5f5f7;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  }

  .calculator-title {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.4rem;
    color: #333;
  }

  .calculator {
    display: flex;
    flex-direction: column;
  }

  .calc-display {
    height: 56px;
    font-size: 2rem;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    margin-bottom: 1rem;
    text-align: right;
    letter-spacing: 0.05em;
    user-select: none;
  }

  .calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .btn {
    all: unset;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e2e3e7;
    border-radius: 12px;
    font-size: 1.7rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    height: 56px;
    transition: background-color 0.25s ease;
  }

  .btn:hover {
    background-color: #cacbd2;
  }

  .operator-btn {
    background: #ff9f0a;
    color: white;
  }

  .operator-btn:hover {
    background: #e38b00;
  }

  .func-btn {
    background: #a3a4a8;
    color: white;
  }

  .func-btn:hover {
    background: #808184;
  }

  .equal-btn {
    background: #007aff;
    color: white;
    grid-column: span 1;
  }

  .equal-btn:hover {
    background: #005ecb;
  }

  @media (max-width: 400px) {
    .calculator-container {
      max-width: 100%;
      padding: 0.5rem;
      margin: 0.5rem;
    }

    .calc-display {
      font-size: 1.6rem;
      height: 48px;
      padding: 0 8px;
    }

    .btn {
      height: 48px;
      font-size: 1.1rem;
    }
  }