:root {
  --bg: #050b16;
  --surface: rgba(12, 25, 47, 0.78);
  --surface-solid: #0c192f;
  --surface-raised: #10223e;
  --border: rgba(116, 167, 255, 0.18);
  --border-strong: rgba(98, 190, 255, 0.38);
  --text: #f5f9ff;
  --muted: #96a9c6;
  --accent: #5cc8ff;
  --accent-2: #5478ff;
  --success: #61e4b4;
  --danger: #ff7f91;
  --warning: #ffbd59;
  --focus: #8ddbff;
  --shadow: 0 26px 80px rgba(0, 5, 17, 0.48);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 14%, rgba(45, 110, 225, 0.16), transparent 32rem),
    radial-gradient(circle at 85% 48%, rgba(20, 179, 209, 0.07), transparent 28rem),
    linear-gradient(180deg, #07101f 0%, var(--bg) 46%, #040914 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image: linear-gradient(rgba(115, 167, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(115, 167, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  color: #04111f;
  background: var(--focus);
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(72, 141, 255, 0.18), rgba(32, 210, 228, 0.07));
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  box-shadow: inset 0 0 18px rgba(51, 169, 255, 0.08);
}

.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: 0.12em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 0.75rem; }

.header-status {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #b8c9df;
  font-size: 0.8125rem;
}
.header-status span { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 12px rgba(97, 228, 180, 0.75); }

main { width: min(100% - 32px, 1120px); margin: 0 auto; }

.intro { margin: 54px auto 36px; text-align: center; }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--accent); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; }
.intro h1 { max-width: 720px; margin: 0 auto; font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1.02; letter-spacing: -0.055em; }
.intro h1 span { color: transparent; background: linear-gradient(95deg, #75d9ff, #8198ff); background-clip: text; -webkit-background-clip: text; }
.intro > p:last-child { margin: 20px auto 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }

.generator-card {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 42px);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(16, 35, 65, 0.89), rgba(7, 17, 34, 0.93));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}


.generator-card::before {
  position: absolute;
  top: -2px;
  left: 13%;
  width: 74%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(89, 198, 255, 0.8), transparent);
  box-shadow: 0 0 24px rgba(89, 198, 255, 0.45);
}

.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.card-heading h2 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.75rem); letter-spacing: -0.025em; }
.section-kicker { margin-bottom: 7px; }
.private-badge { display: inline-flex; flex-shrink: 0; gap: 7px; align-items: center; padding: 8px 11px; color: #aeead6; font-size: 0.75rem; font-weight: 700; background: rgba(58, 202, 151, 0.08); border: 1px solid rgba(97, 228, 180, 0.22); border-radius: 99px; }
.private-badge svg, .not-stored svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

label { display: inline-block; margin-bottom: 10px; font-size: 0.9rem; font-weight: 700; }
.input-shell { display: flex; align-items: center; min-height: 58px; padding-right: 6px; background: rgba(2, 9, 20, 0.66); border: 1px solid var(--border); border-radius: 13px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.input-shell:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.08); }
.input-shell input { min-width: 0; flex: 1; padding: 16px; color: var(--text); background: transparent; border: 0; outline: 0; }
.input-shell input::placeholder { color: #6e819e; }
.input-actions { display: flex; flex-shrink: 0; }
.input-action { min-width: 62px; min-height: 42px; padding: 0 12px; color: var(--muted); font-size: 0.8125rem; font-weight: 700; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.input-action:hover { color: var(--text); background: rgba(130, 175, 255, 0.08); }
.input-action-accent { color: var(--accent); }
.input-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: #70849f; font-size: 0.75rem; }
.not-stored { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.error-message { min-height: 22px; margin: 6px 0 0; color: var(--danger); font-size: 0.875rem; }

.otp-zone { display: block; width: 100%; margin: 12px 0 24px; padding: clamp(32px, 6vw, 52px) 0 clamp(28px, 5vw, 42px); overflow: hidden; background: linear-gradient(90deg, transparent, rgba(69, 137, 230, 0.055), transparent); text-align: center; }
.otp-label, .refresh-label { margin: 0; color: #7185a3; font-size: 0.8125rem; letter-spacing: 0.09em; text-transform: uppercase; }
.otp-code { display: block; width: 100%; max-width: 100%; margin: 15px auto 13px; padding: 6px 0; overflow: hidden; font-size: clamp(2.45rem, 14vw, 4.75rem); font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: 0.025em; white-space: nowrap; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.otp-code:disabled { color: #526783; cursor: default; }
.otp-zone[data-state="active"] .otp-code { text-shadow: 0 0 32px rgba(92, 200, 255, 0.16); }
.otp-zone[data-state="warning"] .otp-code { color: var(--warning); }
.otp-zone.code-updated .otp-code { animation: code-in 360ms ease-out; }

.timer-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 0.875rem; }
.timer-row p { margin: 0 0 10px; }
.expires { color: #bed0e8; font-variant-numeric: tabular-nums; }
.progress-track { display: block; width: 100%; height: 6px; overflow: hidden; appearance: none; background: rgba(91, 135, 193, 0.14); border: 0; border-radius: 99px; }
.progress-track::-webkit-progress-bar { background: rgba(91, 135, 193, 0.14); border-radius: 99px; }
.progress-track::-webkit-progress-value { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; transition: width 200ms linear, background 200ms ease; }
.progress-track::-moz-progress-bar { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; transition: background 200ms ease; }
.progress-track.is-warning::-webkit-progress-value { background: linear-gradient(90deg, #e39042, var(--warning)); }
.progress-track.is-warning::-moz-progress-bar { background: linear-gradient(90deg, #e39042, var(--warning)); }

.button-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; margin-top: 26px; }
.primary-button, .secondary-button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: 9px; padding: 0 20px; font-weight: 750; border-radius: 11px; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.primary-button { color: #04111f; background: linear-gradient(100deg, #76d8ff, #6b8dff); border: 0; box-shadow: 0 12px 28px rgba(64, 133, 255, 0.17); }
.secondary-button { color: #b9c8dc; background: rgba(111, 151, 210, 0.05); border: 1px solid var(--border); }
.primary-button svg, .secondary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { transform: translateY(-1px); }
.secondary-button:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(111, 151, 210, 0.1); }
button:disabled { opacity: 0.48; cursor: not-allowed; }
.copy-status { min-height: 20px; margin: 10px 0 0; color: var(--success); font-size: 0.8125rem; text-align: center; }
.share-note { max-width: 590px; margin: 2px auto -12px; color: #7f91aa; font-size: 0.72rem; line-height: 1.5; text-align: center; }

.ad-placement { display: flex; max-width: 100vw; margin: 16px auto 0; flex-direction: column; align-items: center; gap: 8px; color: #5f718b; text-align: center; }
.ad-placement--top { width: 468px; margin-top: 20px; }
.ad-placement--middle, .ad-placement--bottom { width: 728px; margin-top: 28px; }
.ad-placement span { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.17em; text-transform: uppercase; }
.ad-placement[hidden] { display: none; }
.ad-placement[data-ad-state="loading"] { position: absolute; left: -10000px; margin: 0; visibility: hidden; pointer-events: none; transform: none; }
.ad-placement-frame { display: block; max-width: 100%; flex: 0 0 auto; overflow: hidden; background: transparent; border: 0; }
.ad-placement--top .ad-placement-frame { width: 468px; height: 60px; }
.ad-placement--middle .ad-placement-frame { width: 728px; height: 210px; }
.ad-placement--bottom .ad-placement-frame { width: 728px; height: 90px; }

footer { display: flex; justify-content: space-between; gap: 20px; width: min(100% - 32px, 1120px); margin: 42px auto 0; padding: 24px 0 34px; color: #70819a; font-size: 0.8125rem; border-top: 1px solid rgba(116, 167, 255, 0.09); }
footer p { margin: 0; }
footer button { padding: 0; color: #92a8c5; background: none; border: 0; cursor: pointer; }
footer button:hover { color: var(--text); }

dialog { width: min(calc(100% - 32px), 480px); padding: 26px; color: var(--text); background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(1, 5, 13, 0.76); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0; font-size: 1.3rem; }
.dialog-heading button { width: 38px; height: 38px; color: var(--muted); font-size: 1.7rem; line-height: 1; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
dialog p { color: var(--muted); line-height: 1.65; }

@keyframes code-in { from { opacity: 0.3; transform: translateY(5px) scale(0.985); } to { opacity: 1; transform: none; } }

@media (max-width: 680px) {
  .site-header { padding: 18px 0; }
  .header-status { display: none; }
  .intro { margin-top: 34px; }
  .intro > p:last-child br { display: none; }
  .card-heading { display: block; }
  .private-badge { margin-top: 14px; }
  .button-row { grid-template-columns: 1fr 1fr; }
  .button-row .primary-button { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .ad-placement--top { width: 320px; }
  .ad-placement--top .ad-placement-frame { width: 320px; height: 50px; }
  .ad-placement--middle { width: 320px; }
  .ad-placement--middle .ad-placement-frame { width: 320px; height: 100px; }
  .ad-placement--bottom { width: 300px; }
  .ad-placement--bottom .ad-placement-frame { width: 300px; height: 250px; }
}

@media (max-width: 440px) {
  .site-header, main, footer { width: min(100% - 24px, 1120px); }
  .ad-placement { position: relative; left: 50%; margin-right: 0; margin-left: 0; transform: translateX(-50%); }
  .generator-card { padding: 20px 16px 24px; border-radius: 18px; }
  .input-shell input { width: 100%; padding-right: 8px; }
  .input-action { min-width: 58px; padding-inline: 9px; }
  .otp-zone { margin-top: 8px; padding-block: 34px 30px; }
  .otp-code { font-size: clamp(2.45rem, 14vw, 3.5rem); letter-spacing: 0.015em; }
  .timer-row { display: block; text-align: center; }
  .button-row { grid-template-columns: 1fr; }
  .button-row .primary-button { grid-column: auto; }
  footer { display: block; text-align: center; }
  footer button { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@supports not (backdrop-filter: blur(1px)) {
  .generator-card, dialog { background: var(--surface-solid); }
}
