/* ================================================================
   FriendsByChance — auth.css
   Login / Registration modal styles
   ================================================================ */

/* ── Modal overlay ─────────────────────────────────────────────── */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal box ──────────────────────────────────────────────────── */
.auth-modal {
    background: var(--color-surface);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 32px 28px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}

/* Full-screen on mobile */
@media (max-width: 599px) {
    .auth-modal-overlay {
        align-items: flex-end;
    }
    .auth-modal {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
        padding: 24px 20px 20px;
    }
}

/* ── Close button ───────────────────────────────────────────────── */
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.auth-modal-close:hover { color: var(--color-text-primary); }
.auth-modal-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── Headings ───────────────────────────────────────────────────── */
.auth-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    margin-bottom: 22px;
}

/* A form's section titles: .fbc-section-title--ruled (components/shared.css). */

/* ── Form groups ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 5px;
}

.form-label .optional-tag {
    font-weight: 400;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    margin-left: 4px;
}
/* Beside a section's title: not in its capitals. */
.fbc-section-title .optional-tag {
    text-transform: none;
    font-size: 0.85rem;
}
/* "Describe it", under the gender choices (user-form.js). */
.form-group.gender-custom-group { margin-top: 10px; }

/* ── Inputs ─────────────────────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--color-divider);
    border-radius: 7px;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    background: var(--color-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

.form-input.is-valid   { border-color: #4caf50; }
.form-input.is-invalid { border-color: #e53935; }

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Textarea */
textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ── Input with trailing icon/button ────────────────────────────── */
.input-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.input-row .form-input { flex: 1; }

.input-row .btn-icon {
    flex-shrink: 0;
    padding: 9px 11px;
    background: var(--color-bg);
    border: 1.5px solid var(--color-divider);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.input-row .btn-icon:hover {
    background: var(--color-divider);
    border-color: var(--color-primary-light);
    color: var(--color-text-primary);
}

/* ── Hint / error text ──────────────────────────────────────────── */
.form-hint {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ── Nick availability indicator ────────────────────────────────── */
.nick-status {
    font-size: 0.78rem;
    margin-top: 4px;
    min-height: 16px;
}
.nick-status.checking { color: var(--color-text-secondary); }
.nick-status.available { color: #4caf50; }
.nick-status.taken     { color: #e53935; }
.nick-status.invalid   { color: #e53935; }

/* ── Password strength ──────────────────────────────────────────── */
.strength-track {
    height: 4px;
    background: var(--color-divider);
    border-radius: 2px;
    margin-top: 7px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.25s, background 0.25s;
}

.strength-bar.weak   { width: 33%; background: #e53935; }
.strength-bar.medium { width: 66%; background: #fb8c00; }
.strength-bar.strong { width: 100%; background: #4caf50; }

.strength-label {
    font-size: 0.75rem;
    margin-top: 3px;
}
.strength-label.weak   { color: #e53935; }
.strength-label.medium { color: #fb8c00; }
.strength-label.strong { color: #4caf50; }

/* ── Weak password warning box ──────────────────────────────────── */
.weak-password-warning {
    background: #fff3e0;
    border: 1px solid #fb8c00;
    border-radius: 7px;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: #e65100;
    margin-bottom: 16px;
    display: none;
}
.weak-password-warning.visible { display: block; }
.weak-password-accept {
    margin-top:  8px;
    display:     flex;
    align-items: center;
    gap:         8px;
}

/* ── Radio / checkbox groups ────────────────────────────────────── */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.gender-extra {
    margin-top: 12px;
    padding: 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-divider);
    border-radius: 7px;
    display: none;
}
.gender-extra.visible { display: block; }

/* ── Contact list ───────────────────────────────────────────────── */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.contact-item {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.contact-item .contact-type {
    flex: 0 0 auto;
    min-width: 0;
}

.contact-item .contact-value {
    flex: 1;
    min-width: 120px;
}

.contact-item .contact-platform {
    flex: 0 0 auto;
    min-width: 0;
}
.contact-item .contact-platform[hidden] { display: none; }

/* A row's remove: the app's delete (FBC.ui.iconBtn) — a 44px target (as
   times.css's rows); the row's type and platform are fields, as tall as
   its input (SegmentedChoice `field`). */
.contact-item .btn-remove,
.description-item-header .btn-remove {
    width:         44px;
    height:        44px;
    border-radius: 8px;
}

/* ── Description list ───────────────────────────────────────────── */
.description-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 10px;
}

.description-item {
    border: 1px solid var(--color-divider);
    border-radius: 8px;
    padding: 12px;
}

.description-item-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.description-item-header .form-input { flex: 1; }

/* ── Quill editor overrides ─────────────────────────────────────── */
.ql-container.ql-snow {
    border-color: var(--color-divider);
    border-radius: 0 0 6px 6px;
    font-size: 0.9rem;
}

.ql-toolbar.ql-snow {
    border-color: var(--color-divider);
    border-radius: 6px 6px 0 0;
}

.ql-editor {
    min-height: 80px;
}

/* ── "Add" buttons ──────────────────────────────────────────────── */
.btn-add {
    background: none;
    border: 1.5px dashed var(--color-primary-light);
    border-radius: 7px;
    padding: 8px 14px;
    color: var(--color-primary);
    font-size: 0.87rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}
.btn-add:hover {
    background: rgba(74, 124, 89, 0.06);
    border-color: var(--color-primary);
}

/* ── Main action buttons ────────────────────────────────────────── */
.auth-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.97rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover   { background: var(--color-primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    width: 100%;
    padding: 10px;
    background: none;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(74, 124, 89, 0.06); }

/* ── SSO section ────────────────────────────────────────────────── */
.sso-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}
.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-divider);
}

.sso-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sso-btn {
    flex: 1;
    min-width: 80px;
    padding: 9px 8px;
    background: var(--color-bg);
    border: 1.5px solid var(--color-divider);
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: not-allowed;
    color: var(--color-text-secondary);
    text-align: center;
    opacity: 0.6;
    position: relative;
}

.sso-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* ── Auth switch link ───────────────────────────────────────────── */
.auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 18px;
}

.auth-switch a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Captcha step ───────────────────────────────────────────────── */
.captcha-box {
    background: var(--color-bg);
    border: 1px solid var(--color-divider);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.captcha-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.captcha-input {
    width: 100px;
    text-align: center;
    font-size: 1rem;
    padding: 8px;
    border: 1.5px solid var(--color-divider);
    border-radius: 7px;
}
.captcha-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

/* ── 2FA step ───────────────────────────────────────────────────── */
.twofa-code-input {
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 0.2em;
    padding: 10px;
}

.twofa-hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 8px;
    margin-bottom: 16px;
}

.twofa-resend {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    display: block;
    margin: 0 auto 16px;
}
.twofa-resend:disabled { opacity: 0.5; cursor: default; }

/* ── Global error banner ────────────────────────────────────────── */
.auth-banner {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #c62828;
    margin-bottom: 16px;
    display: none;
}
.auth-banner.visible { display: block; }

.auth-banner.success {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

/* ── The menu's items (nav.js) ─────────────────────────────────────
   A row each: the page's icon in the app's green, its name; finger-high,
   a soft rounded hover; the page on screen a green-tinted pill, its words
   green.  A page's own switch at the row's end (The Map's "wide").  Log
   out last, set apart by a line, in red.  At the top, the pin — only
   where the menu can be a pane (FBC.shell). */
.nav-head {
    display:         flex;
    justify-content: flex-end;
    padding:         0 4px 4px;
}
.nav-item-auth {
    display:     flex;
    align-items: center;
    gap:         6px;
    list-style:  none;
}
.nav-item-auth .nav-link {
    flex:          1;
    min-width:     0;
    display:       flex;
    align-items:   center;
    gap:           14px;
    min-height:    44px;
    padding:       0 14px;
    border:        none;
    border-radius: 10px;
    background:    none;
    font-size:     0.95rem;
    color:         var(--color-text-primary);
    text-align:    left;
    cursor:        pointer;
    transition:    background 0.15s, color 0.15s;
}
.nav-item-auth .nav-link:hover         { background: var(--color-hover); }
.nav-item-auth .nav-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.nav-icon                { display: flex; flex: none; color: var(--color-primary); }
.nav-icon svg            { width: 20px; height: 20px; }
.nav-label               { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item-auth.nav-active .nav-link {
    background:  var(--color-selected);
    color:       var(--color-primary-dark);
    font-weight: 600;
}
.nav-toggle { flex: none; margin-right: 6px; }
.nav-item-auth.nav-logout {
    margin-top:  auto;
    padding-top: 10px;
    border-top:  1px solid var(--color-divider);
}
.nav-item-auth.nav-logout .nav-link,
.nav-item-auth.nav-logout .nav-icon { color: var(--color-danger); }
.nav-item-auth.nav-logout .nav-link:hover { background: rgba(192, 57, 43, 0.08); }

/* ── Profile picture preview ────────────────────────────────────── */
.avatar-preview-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}
.avatar-preview-wrap > input[type="file"] { flex: 1; }

.avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-divider);
    display: none;
}
.avatar-preview.visible { display: block; }
