:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #171b20;
  --panel-strong: #20262d;
  --line: #343d47;
  --text: #f3f7fb;
  --muted: #aab5c0;
  --soft: #d9e3ec;
  --accent: #19b7e6;
  --accent-strong: #7bdff8;
  --danger: #ffb4a8;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(25, 183, 230, 0.16), transparent 30rem),
    linear-gradient(135deg, #0b0d10, #15181d 58%, #0d1014);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 48px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: 4rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--soft);
  font-size: 1.06rem;
  line-height: 1.6;
}

.section {
  margin: 28px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

h2 {
  margin-bottom: 0;
  color: var(--accent-strong);
  font-size: 1.35rem;
}

.current-time,
.timezone-selection,
.output-time {
  display: grid;
  gap: 14px;
}

.current-time {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zone-time,
.converter-form {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 27, 32, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.zone-time {
  min-width: 0;
  border-radius: 8px;
  padding: 18px;
}

.zone-time h3 {
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.3;
}

.zone-label,
.date,
.dst-indicator {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.zone-label {
  margin-bottom: 2px;
}

.time {
  display: block;
  margin: 10px 0 10px;
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dst-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daypart-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.daypart-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.converter-form {
  border-radius: 8px;
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 18px;
}

.field,
.time-field,
.timezone-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field span,
.time-field legend,
.timezone-field legend {
  display: block;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.input-shell {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.input-shell.compact {
  width: 116px;
}

.input-icon {
  width: 22px;
  height: 22px;
  margin-left: 14px;
  color: var(--accent-strong);
  flex: 0 0 auto;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
}

input::placeholder {
  color: #7e8a95;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.time-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.time-separator {
  margin: 0;
  color: var(--soft);
  font-size: 1.35rem;
  font-weight: 700;
}

.minute-input {
  width: 76px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  text-align: center;
}

.ampm-select {
  display: flex;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.ampm-select.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ampm-select button,
.tz-box,
.convert-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  cursor: pointer;
}

.ampm-select button {
  min-height: 48px;
  padding: 0 15px;
  color: var(--soft);
}

.ampm-select button.active,
.tz-box.selected {
  border-color: rgba(25, 183, 230, 0.78);
  background: rgba(25, 183, 230, 0.16);
  color: #ffffff;
}

.timezone-field {
  margin-top: 22px;
}

.timezone-selection {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tz-box {
  min-height: 62px;
  padding: 11px 12px;
  color: var(--text);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tz-box:hover,
.convert-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 223, 248, 0.58);
}

.tz-box span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-message {
  min-height: 1.4em;
  margin: 16px 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.convert-btn {
  min-height: 50px;
  min-width: 170px;
  padding: 0 28px;
  background: linear-gradient(135deg, #1288ad, #1b5f7d);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.output-time {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.output-time:empty {
  display: none;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 9, 12, 0.54);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .current-time,
  .timezone-selection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .output-time {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 24px, 1100px);
  }

  .site-header {
    padding-top: 32px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .current-time,
  .timezone-selection {
    grid-template-columns: 1fr;
  }

  .converter-form,
  .zone-time {
    padding: 16px;
  }

  .time-controls {
    flex-wrap: wrap;
  }

  .ampm-select {
    width: 100%;
  }

  .ampm-select button {
    flex: 1;
  }

  .site-footer .container {
    flex-direction: column;
  }
}
