/* Passwordless sign-in popup, smart identifier field and one-time code (hand-written, no build). */
.sfa-modal { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto; padding: 0; border: 0; border-radius: 20px; background: #fff; color: #111; box-shadow: 0 24px 70px rgba(0, 0, 0, .25); overflow: visible; font-family: 'Montserrat', sans-serif; }
.sfa-modal::backdrop { background: rgba(17, 17, 17, .55); backdrop-filter: blur(2px); }
html.sfa-open, html.sfa-open body { overflow: hidden; }
.sfa-panel { position: relative; padding: 36px 32px 30px; max-height: calc(100vh - 24px); overflow-y: auto; }
.sfa-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3f3f3; cursor: pointer; }
.sfa-close::before, .sfa-close::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; border-radius: 2px; background: #111; transform: rotate(45deg); }
.sfa-close::after { transform: rotate(-45deg); }
.sfa-close:hover { background: #e9e9e9; }

.sfa-form { display: grid; gap: 14px; text-align: left; }
.sfa-form.is-busy { opacity: .7; pointer-events: none; }
.sfa-title { margin: 0 40px 0 0; font-size: 24px; line-height: 1.25; font-weight: 700; }
.sfa-lead { margin: -4px 0 6px; color: #555; font-size: 14px; line-height: 1.55; }
.sfa-lead b { color: #111; white-space: nowrap; }

/* identifier field */
.sfa-field-box { position: relative; }
.sfa-field-input { box-sizing: border-box; width: 100%; height: 54px; padding: 0 92px 0 18px; border: 1.5px solid #d9d9d9; border-radius: 14px; background: #fff; color: #111; font: 500 17px/1 'Montserrat', sans-serif; letter-spacing: .01em; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; }
.sfa-field-input::placeholder { color: #a5a5a5; font-weight: 400; }
.sfa-field-input:focus { border-color: #111; box-shadow: 0 0 0 4px rgba(251, 178, 222, .35); }
.sfa-field-kind { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); padding: 4px 10px; border-radius: 999px; background: #f4f1ea; color: #555; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }
.sfa-field-kind:empty { display: none; }
.sfa-field.is-valid .sfa-field-kind { background: #e7f6ec; color: #18794e; }
.sfa-field.is-error .sfa-field-input { border-color: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .12); }
.sfa-field.is-error .sfa-field-kind { background: #fdecea; color: #b42318; }
.sfa-field-message { margin: 6px 2px 0; min-height: 0; color: #b42318; font-size: 13px; line-height: 1.4; }
.sfa-field-message:empty { display: none; }

/* buttons */
.sfa-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px 20px; border: 0; border-radius: 48px; font: 600 16px/1.2 'Montserrat', sans-serif; color: #111; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.sfa-button-primary { background: linear-gradient(128deg, #fbb2de 0%, #fff287 100%); }
.sfa-button-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(251, 178, 222, .45); }
.sfa-button[disabled] { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.sfa-button-alt { background: #fff; border: 1.5px solid #e1e1e1; font-weight: 500; font-size: 15px; }
.sfa-button-alt:hover { border-color: #111; }
.sfa-icon { display: inline-flex; }

/* «АБО» with lines */
.sfa-or { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; color: #8a8a8a; font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.sfa-or::before, .sfa-or::after { content: ''; flex: 1; height: 1px; background: #e4e4e4; }
.sfa-alt { display: grid; gap: 10px; }
.sfa-note { margin: 12px 0 0; color: #555; font-size: 13px; line-height: 1.45; text-align: center; }
.sfa-note:empty { display: none; }
.sfa-legal { margin: 14px 0 0; color: #888; font-size: 12px; line-height: 1.45; text-align: center; }
.sfa-legal a { color: inherit; text-decoration: underline; }
.sfa-legal a:hover { color: #000; }

/* one-time code: one real input over six painted cells, no caret */
.sfa-code { position: relative; margin: 4px 0 0; }
.sfa-code-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sfa-code-cell { display: flex; align-items: center; justify-content: center; height: 60px; border: 1.5px solid #d9d9d9; border-radius: 14px; background: #fff; font: 700 26px/1 'Montserrat', sans-serif; font-variant-numeric: tabular-nums; color: #111; transition: border-color .15s, box-shadow .15s, background .15s, transform .15s; }
.sfa-code-cell.is-filled { border-color: #b9b9b9; }
.sfa-code-cell.is-active { border-color: #111; box-shadow: 0 0 0 4px rgba(251, 178, 222, .35); }
.sfa-code-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; outline: none; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; letter-spacing: 0; -webkit-text-fill-color: transparent; opacity: 0.01; cursor: text; }
.sfa-code-input::selection { background: transparent; }
.sfa-code.is-busy .sfa-code-cell { opacity: .65; }
.sfa-code.is-error .sfa-code-cell { border-color: #d92d20; background: #fdecea; color: #b42318; animation: sfa-shake .4s; }
.sfa-code.is-success .sfa-code-cell { border-color: #18794e; background: #e7f6ec; color: #18794e; }
@keyframes sfa-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sfa-code-message { margin: 0; color: #b42318; font-size: 13px; line-height: 1.4; min-height: 18px; }
.sfa-resend { margin: 0; }
.sfa-link { padding: 0; border: 0; background: none; color: #111; font: 600 14px/1.4 'Montserrat', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sfa-link[disabled] { color: #8a8a8a; text-decoration: none; cursor: default; }
.sfa-hint { margin: 0; color: #777; font-size: 12px; line-height: 1.45; }

@media (max-width: 480px) {
    .sfa-modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
    .sfa-panel { padding: 30px 20px calc(24px + env(safe-area-inset-bottom)); }
    .sfa-title { font-size: 21px; }
    .sfa-code-cells { gap: 6px; }
    .sfa-code-cell { height: 54px; font-size: 23px; border-radius: 12px; }
}

/* Profile → Edit: contacts card */
.sfContacts { margin-top: 36px; }
.sfContactsLead { margin: -6px 0 16px; color: #555; font-size: 14px; line-height: 1.55; }
.sfContact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px; margin-bottom: 12px; border: 1.5px solid #ececec; border-radius: 16px; background: #fff; }
.sfContactInfo p { margin: 0; }
.sfContactLabel { color: #8a8a8a; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sfContactValue { margin-top: 2px !important; font-size: 16px; font-weight: 600; word-break: break-word; }
.sfContactStatus { margin-top: 4px !important; font-size: 13px; font-weight: 500; }
.sfContactStatus.is-ok { color: #18794e; }
.sfContactStatus.is-warn { color: #b54708; }
.sfContactActions { display: flex; gap: 8px; }
.sfContactButton { min-height: 40px; padding: 8px 18px; border: 1.5px solid #e1e1e1; border-radius: 40px; background: #fff; color: #111; font: 600 14px/1.2 'Montserrat', sans-serif; cursor: pointer; }
.sfContactButton:hover { border-color: #111; }
.sfContactButton.is-primary { border-color: transparent; background: linear-gradient(128deg, #fbb2de 0%, #fff287 100%); }
.sfPasskeysEmpty { margin: 0 0 14px; color: #777; font-size: 14px; }
.sfPasskeysStatus { margin: 10px 0 0; color: #b42318; font-size: 14px; }
.sfPasskeysStatus:empty { display: none; }
.sfPasskeysGoogle { margin: 14px 0 0; color: #18794e; font-size: 14px; font-weight: 500; }
