/* Responsive styles for the static authenticator demo */
:root {
  --text: #151515;
  --muted: #6b7280;
  --border: #d7dbe2;
  --surface: #fff;
  --bg: #f6f7f9;
  --accent-a: #6d99ed;
  --accent-b: #7464ed;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: center;
  gap: clamp(32px, 7vw, 100px);
  min-height: 650px;
}

.setup-panel { text-align: center; }

.setup-panel h1,
.console-panel h2 {
  margin: 0 0 28px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  font-weight: 300;
  letter-spacing: .01em;
}

.qr-wrap {
  display: inline-flex;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(20, 25, 35, .07);
}

.qrcode {
  display: grid;
  place-items: center;
  width: min(166px, 48vw);
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff;
}

.qrcode svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scan, .verify {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.scan { margin: 14px 0 0; }
.scan a { color: #315db8; }

.verify { margin-top: 28px; }
.token-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 500;
}

.verify-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

input {
  min-width: 0;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus {
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(109, 153, 237, .16);
}

.token-input {
  width: 170px;
  text-align: center;
  letter-spacing: .08em;
}

.btn {
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(100, 100, 220, .2);
}

.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }

.btn-secondary {
  background: #fff;
  color: #394150;
  border: 1px solid var(--border);
  box-shadow: none;
}

.status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
}

.phone-panel {
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1143 / 2055;
}

.iPhone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.iframe-container {
  position: absolute;
  width: 65.6%;
  height: 73.3%;
  left: 17.2%;
  top: 13.2%;
  overflow: hidden;
  border-radius: 8%;
}

.iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.console-panel {
  width: min(760px, 100%);
  margin: 24px auto 0;
  padding: clamp(22px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px rgba(20, 25, 35, .06);
}

.console-panel h2 {
  text-align: center;
  margin-bottom: 18px;
}

hr {
  height: 1px;
  margin: 0 0 28px;
  border: 0;
  background: var(--border);
}

.form-group {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group label, .uri-block > label {
  font-weight: 600;
  font-size: 14px;
}

.form-group input { width: 100%; }

.actions {
  display: flex;
  justify-content: flex-end;
  margin: 22px 0 24px;
}

.uri-block {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.js-otpauth {
  display: block;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  color: #555b66;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fade { opacity: 0; }
.in { opacity: 1; transition: opacity .4s ease; }

@media (max-width: 800px) {
  .page { padding: 24px 16px 40px; }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 42px;
  }

  .setup-panel { order: 1; }
  .phone-panel { order: 2; }
  .phone { width: min(300px, 78vw); }

  .console-panel { margin-top: 18px; }
}

@media (max-width: 520px) {
  .page { padding: 20px 12px 32px; }

  .setup-panel h1 { margin-bottom: 20px; }

  .verify-row {
    flex-direction: column;
    align-items: stretch;
  }

  .token-input,
  .verify-row .btn {
    width: 100%;
  }

  .form-group,
  .uri-block {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .fade, .in, input, .btn { transition: none; }
}



/* Mobile interaction refinements */
button,
input {
  -webkit-tap-highlight-color: transparent;
}

.btn {
  touch-action: manipulation;
}

@media (max-width: 800px) {
  .hero {
    align-items: start;
  }

  .setup-panel,
  .phone-panel {
    width: 100%;
  }

  .console-panel {
    box-shadow: 0 6px 24px rgba(20, 25, 35, .05);
  }
}

@media (max-width: 520px) {
  html {
    overflow-x: hidden;
  }

  body {
    min-width: 320px;
  }

  .page {
    width: 100%;
  }

  .qr-wrap {
    padding: 8px;
  }

  .qrcode {
    width: min(180px, 62vw);
  }

  .verify {
    margin-top: 24px;
  }

  .phone {
    width: min(280px, 82vw);
  }

  .console-panel {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .js-otpauth {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .setup-panel h1,
  .console-panel h2 {
    font-size: 26px;
  }

  .phone {
    width: 76vw;
  }
}


/* Clear, high-visibility verification feedback */
.js-status {
  min-height: 2.5rem;
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.status-success { color: #137333; background: #e6f4ea; border: 1px solid #a8dab5; }
.status-error { color: #b3261e; background: #fce8e6; border: 1px solid #f2b8b5; }
