/* Shared look for the sign-in, sign-up, passcode and account pages: responsive card, friendly form fields. */
body.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: clamp(16px, 5vw, 40px) 16px;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(243,169,60,.13), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(98,201,232,.10), transparent 60%),
    var(--ink);
}
.auth .box { width: min(440px, 100%); display: grid; gap: 18px; }
.auth .brandrow { display: flex; justify-content: center; font-size: clamp(20px, 5vw, 24px); }
.auth .lead { text-align: center; display: grid; gap: 4px; margin: 0 4px; }
.auth .lead h1 { font-size: clamp(22px, 6vw, 28px); }
.auth .lead p { margin: 0; color: var(--muted); font-size: 14px; }

.card {
  background: linear-gradient(180deg, var(--panel), #0f1520);
  border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 5vw, 28px);
  display: grid; gap: 16px; align-content: start; min-width: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -24px rgba(0,0,0,.7);
}
.card h2 { font-size: 18px; }

/* sign in / create account switch */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 11px 8px; border-radius: 9px; font: 600 14px var(--f-body); cursor: pointer; transition: color .15s, background .15s; min-height: 44px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }

form { display: grid; gap: 16px; }

/* fields: label on top, soft rounded input, optional icon on the left and a button on the right */
label.f { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
label.f > span.cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
label.f > span.cap em { font-style: normal; font-size: 12px; color: var(--faint); }
.field { position: relative; display: block; }
.field > svg.ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; transition: color .15s; }
.field:focus-within > svg.ic { color: var(--amber); }
.field.has-ic input { padding-left: 42px; }
.field .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--faint); border-radius: 9px; cursor: pointer; }
.field .eye:hover { color: var(--text); background: rgba(255,255,255,.05); }
.field .eye svg { width: 19px; height: 19px; }
.field.has-eye input { padding-right: 48px; }

input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font: 16px/1.3 var(--f-body); color: var(--text);   /* 16px stops iOS zooming in */
  background: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: #3a4864; }
input:focus, select:focus { border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); background: #0d121b; }
input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px var(--ink) inset; caret-color: var(--text); }
input.bad { border-color: var(--short); box-shadow: 0 0 0 4px var(--short-soft); }
input.good { border-color: rgba(44,195,139,.6); }
input[inputmode="numeric"] { letter-spacing: .3em; font-family: var(--f-mono); text-align: center; }
select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b95a9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
input[type="date"] { color-scheme: dark; }

.btn { min-height: 46px; border-radius: 12px; }
.btn.primary { background: linear-gradient(180deg, #f7b957, var(--amber)); border-color: var(--amber); box-shadow: 0 8px 24px -10px rgba(243,169,60,.7); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { transform: translateY(1px); }
.btn.wide { width: 100%; font-size: 15px; min-height: 50px; }
.btn.sm { min-height: 36px; padding: 8px 12px; border-radius: 9px; }
.btn .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(27,18,4,.3); border-top-color: #1b1204; animation: sp .7s linear infinite; margin-right: 8px; }
.btn.busy .spin { display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }

.hint { font-size: 12.5px; color: var(--faint); line-height: 1.5; margin: 0; }
.msg { font-size: 13px; min-height: 18px; }
.msg.err { color: var(--short); } .msg.ok { color: var(--long); }
.banner { padding: 11px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid var(--line); line-height: 1.45; }
.banner.ok { border-color: rgba(80,200,140,.5); background: rgba(80,200,140,.1); }
.banner.err { border-color: rgba(240,99,111,.5); background: rgba(240,99,111,.1); }
a.link, button.link { color: var(--amber); font-size: 13.5px; cursor: pointer; text-decoration: none; background: none; border: 0; padding: 4px 0; font-family: inherit; text-align: left; }
a.link:hover, button.link:hover { text-decoration: underline; }
.foot { text-align: center; color: var(--faint); font-size: 12.5px; }
.foot a { color: var(--muted); }

/* password strength: four bars */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.meter i { height: 4px; border-radius: 3px; background: var(--line-2); transition: background .2s; }
.meter[data-s="1"] i:nth-child(-n+1) { background: var(--short); }
.meter[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-s="3"] i:nth-child(-n+3) { background: #9ad06c; }
.meter[data-s="4"] i { background: var(--long); }
.meter-t { font-size: 12px; color: var(--faint); min-height: 16px; }

/* account page layout bits */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .card { padding: 16px; border-radius: 14px; } .seg button { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* checkboxes and radios keep their natural size */
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: var(--amber); }
input[type="search"] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
