﻿/* Sign-in and registration: a focused layout (logo, language, one card, legal links). */
body.page-auth { background: #F8FAFC; min-height: 100vh; display: flex; flex-direction: column; }

.auth-hdr { background: transparent; }
.auth-hdr-in { max-width: 1080px; margin: 0 auto; padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-hdr .logo img { display: block; height: 30px; width: auto; }

.auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 20px var(--gutter) 40px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid #E2E8F0; border-radius: 20px; padding: 32px 32px 28px; box-shadow: 0 10px 30px rgba(16, 44, 74, .06); }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #102C4A; }
.auth-sub { margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: #64748B; }
.auth-card form { margin-top: 24px; }
.auth-card [hidden] { display: none !important; }

.demo-note { margin-bottom: 20px; padding: 10px 12px; border: 1px dashed #B9CCE1; border-radius: 12px; background: #F3F8FD; font-size: 13px; line-height: 1.45; color: #35638A; font-weight: 600; }
.demo-note strong { display: block; margin-top: 4px; font-size: 15px; letter-spacing: .12em; color: #102C4A; font-variant-numeric: tabular-nums; }

/* fields: error text has a reserved line so the layout does not jump when it appears */
.field { margin-bottom: 4px; }
.field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: #102C4A; }
.field input { width: 100%; height: 50px; padding: 0 14px; font: inherit; font-size: 16px; /* 16px stops iOS zooming into the field */ color: #102C4A; background: #fff; border: 1px solid #CBD5E1; border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: #94A3B8; }
.field input:hover { border-color: #9DB8D6; }
.field input:focus, .phone-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 93, 166, .16); }
.field input[aria-invalid="true"], .phone-group.is-invalid { border-color: #B42318; }
.field input[aria-invalid="true"]:focus, .phone-group.is-invalid:focus-within { box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }
.field-err { min-height: 22px; margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: #B42318; font-weight: 600; }

.phone-group { display: flex; align-items: center; height: 50px; background: #fff; border: 1px solid #CBD5E1; border-radius: 12px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.phone-group:hover { border-color: #9DB8D6; }
.phone-prefix { flex: none; align-self: stretch; display: flex; align-items: center; padding: 0 12px 0 14px; font-size: 16px; font-weight: 700; color: #102C4A; background: #F1F5F9; border-right: 1px solid #E2E8F0; }
.phone-group input { height: 100%; border: 0; border-radius: 0; box-shadow: none !important; padding-left: 12px; font-variant-numeric: tabular-nums; }

.code-input { text-align: center; font-size: 26px !important; font-weight: 700; letter-spacing: .42em; padding-left: calc(14px + .42em) !important; font-variant-numeric: tabular-nums; }
.code-input::placeholder { letter-spacing: .3em; }

.auth-submit { width: 100%; height: 50px; margin-top: 10px; font-size: 16px; position: relative; justify-content: center; }
.auth-submit .spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: authspin .7s linear infinite; }
.auth-submit.is-loading { pointer-events: none; }
.auth-submit.is-loading .btn-label { opacity: .0; position: absolute; }
.auth-submit.is-loading .spinner { display: block; }
@keyframes authspin { to { transform: rotate(360deg); } }
a.auth-submit { display: flex; align-items: center; margin-top: 24px; }

.social { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.social-or { display: flex; align-items: center; gap: 12px; margin: 0 0 2px; font-size: 13px; color: #64748B; font-weight: 600; }
.social-or::before, .social-or::after { content: ""; flex: 1; height: 1px; background: #E2E8F0; }
.soc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.soc-list { display: flex; flex-direction: column; gap: 10px; }
.ident-hint { min-height: 0; margin: 6px 0 0; font-size: 13.5px; color: #64748B; }
.ident-hint:empty { display: none; }
.soc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; padding: 0 10px; border: 1.5px solid #CBD5E1; border-radius: 12px; background: #fff; color: #102C4A; font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s; }
.soc-btn:hover { background: #F3F8FD; border-color: #9DB8D6; }
.soc-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.soc-btn:disabled { opacity: .6; cursor: default; }
.soc-ic { width: 20px; height: 20px; flex: none; }
.social .field-err { min-height: 0; margin-top: 0; text-align: center; }
.social .field-err:empty { display: none; }
.auth-switch { margin-top: 20px; font-size: 14.5px; color: #64748B; text-align: center; }
.auth-switch a, .legal-note a { color: var(--primary); font-weight: 700; }
.auth-switch a:hover, .legal-note a:hover { text-decoration: underline; }
.legal-note { margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: #64748B; text-align: center; }

.code-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.link-btn-plain { background: none; border: 0; padding: 8px 10px; font: inherit; font-size: 14.5px; font-weight: 700; color: var(--primary); border-radius: 8px; cursor: pointer; }
.link-btn-plain:hover:not(:disabled) { text-decoration: underline; }
.link-btn-plain:disabled { color: #94A3B8; cursor: default; font-weight: 600; }
.link-btn-plain:focus-visible, .auth-card a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.auth-foot { padding: 16px var(--gutter) calc(20px + env(safe-area-inset-bottom)); text-align: center; }
.auth-foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: #64748B; }
.auth-foot a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 479px) {
  .auth-main { padding-top: 8px; }
  .auth-card { border: 0; box-shadow: none; background: transparent; padding: 8px 0 20px; max-width: none; }
  .auth-card h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .auth-submit .spinner { animation-duration: 1.6s; } }
@media (max-width: 479px) { body.page-auth { background: #fff; } .field input, .phone-group { background: #fff; } }


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