/* fpmAuth.css — public auth pages (invite accept / set password).
 *
 * The customer's FIRST impression of IronLink, so it must read as the product:
 * deep-navy console, teal accent, Inter. Styles the markup in
 * IronLink/public/invite.html and drives the JS state classes in
 * IronLink/js/invite.js (fpm-auth-hidden, fpm-auth-met/unmet, fpm-auth-shown).
 * Tokens only — no raw hex/rgba — so it tracks the same light/dark theme as the
 * rest of the console.
 *
 * Catalog: CONSOLE.md → "Auth (public invite / set-password page)".
 */

.fpm-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--fpm-space-xl);
    box-sizing: border-box;
    font-family: var(--fpm-font-family);
    color: var(--fpm-text-primary);
    background:
        radial-gradient(1100px 620px at 50% -12%, var(--fpm-border-accent), transparent 62%),
        var(--fpm-bg-deep);
}

.fpm-auth-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: var(--fpm-space-2xl);
    background: var(--fpm-bg-base);
    border: 1px solid var(--fpm-border-medium);
    border-top: 2px solid var(--fpm-accent);
    border-radius: var(--fpm-radius-lg);
    box-shadow: var(--fpm-shadow-modal);
}

/* ---- Brand header ------------------------------------------------------ */
.fpm-auth-header {
    text-align: center;
    margin-bottom: var(--fpm-space-xl);
}

.fpm-auth-logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--fpm-text-primary);
}

.fpm-auth-logo span {
    color: var(--fpm-accent);
}

/* ---- Titles ------------------------------------------------------------ */
.fpm-auth-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: var(--fpm-text-primary);
    margin: 0 0 var(--fpm-space-xs);
}

.fpm-auth-subtitle {
    font-size: 13.5px;
    line-height: 1.55;
    text-align: center;
    color: var(--fpm-text-secondary);
    margin: 0 0 var(--fpm-space-xl);
}

/* ---- Loading state ----------------------------------------------------- */
.fpm-auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--fpm-space-md);
    padding: var(--fpm-space-xl) 0;
    color: var(--fpm-text-secondary);
    font-size: 14px;
}

.fpm-auth-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--fpm-border-medium);
    border-top-color: var(--fpm-accent);
    border-radius: 50%;
    animation: fpm-auth-spin 0.8s linear infinite;
}

@keyframes fpm-auth-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .fpm-auth-spinner { animation: none; }
}

/* ---- Error (fatal) card ------------------------------------------------ */
.fpm-auth-errorcard {
    text-align: center;
    padding: var(--fpm-space-lg) 0;
}

.fpm-auth-erroricon {
    width: 46px;
    height: 46px;
    margin: 0 auto var(--fpm-space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--fpm-text-on-danger);
    background: var(--fpm-surface-2);
    border: 1px solid var(--fpm-text-on-danger);
    border-radius: 50%;
}

.fpm-auth-errortitle {
    font-size: 17px;
    font-weight: 700;
    color: var(--fpm-text-primary);
    margin-bottom: var(--fpm-space-xs);
}

.fpm-auth-errordesc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--fpm-text-secondary);
}

/* ---- Form -------------------------------------------------------------- */
.fpm-auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--fpm-space-lg);
}

.fpm-auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--fpm-space-sm);
}

.fpm-auth-field label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fpm-text-secondary);
}

.fpm-auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-family: var(--fpm-font-family);
    font-size: 15px;
    color: var(--fpm-text-primary);
    background: var(--fpm-bg-deep);
    border: 1px solid var(--fpm-border-strong);
    border-radius: var(--fpm-radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fpm-auth-field input::placeholder {
    color: var(--fpm-text-muted);
}

.fpm-auth-field input:focus {
    outline: none;
    border-color: var(--fpm-accent);
    box-shadow: var(--fpm-shadow-focus-ring);
}

/* ---- Password requirements checklist ----------------------------------- */
.fpm-auth-reqs {
    list-style: none;
    margin: var(--fpm-space-xs) 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: 12.5px;
    color: var(--fpm-text-muted);
}

.fpm-auth-reqs li {
    position: relative;
    padding-left: 22px;
    transition: color 0.15s ease;
}

.fpm-auth-reqs li::before {
    content: "\25CB";
    position: absolute;
    left: 0;
    color: var(--fpm-text-muted);
}

.fpm-auth-reqs li.fpm-auth-met {
    color: var(--fpm-text-body);
}

.fpm-auth-reqs li.fpm-auth-met::before {
    content: "\2713";
    color: var(--fpm-accent);
    font-weight: 700;
}

.fpm-auth-reqs li.fpm-auth-unmet::before {
    content: "\2022";
    color: var(--fpm-text-secondary);
}

/* ---- Primary button ---------------------------------------------------- */
.fpm-auth-submit {
    width: 100%;
    padding: 12px 16px;
    margin-top: var(--fpm-space-xs);
    font-family: var(--fpm-font-family);
    font-size: 15px;
    font-weight: 600;
    color: var(--fpm-text-inverse);
    background: var(--fpm-accent);
    border: none;
    border-radius: var(--fpm-radius-md);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.fpm-auth-submit:hover {
    background: var(--fpm-accent-light);
}

.fpm-auth-submit:active {
    transform: translateY(1px);
}

.fpm-auth-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---- Inline error message ---------------------------------------------- */
.fpm-auth-msg {
    display: none;
    padding: var(--fpm-space-sm) var(--fpm-space-md);
    font-size: 13px;
    color: var(--fpm-text-on-danger);
    background: var(--fpm-surface-1);
    border: 1px solid var(--fpm-text-on-danger);
    border-radius: var(--fpm-radius-md);
}

.fpm-auth-msg.fpm-auth-shown {
    display: block;
}

/* ---- Footer ------------------------------------------------------------ */
.fpm-auth-footer {
    margin-top: var(--fpm-space-xl);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fpm-text-muted);
}

/* ---- Utility ----------------------------------------------------------- */
.fpm-auth-hidden {
    display: none;
}

/* ---- One-time recovery-code delivery ---------------------------------- */
.fpm-auth-recovery {
    width: min(92vw, 640px);
    max-height: 92vh;
    overflow: auto;
    padding: var(--fpm-space-xl);
    color: var(--fpm-text-primary);
    background: var(--fpm-bg-base);
    border: 1px solid var(--fpm-border-strong);
    border-radius: var(--fpm-radius-lg);
    box-shadow: var(--fpm-shadow-modal);
}

.fpm-auth-recovery::backdrop {
    background: var(--fpm-overlay-bg);
    backdrop-filter: blur(4px);
}

.fpm-auth-recovery__title {
    margin: 0 0 var(--fpm-space-md);
    color: var(--fpm-accent);
    font-size: var(--fpm-font-xl);
}

.fpm-auth-recovery__warning,
.fpm-auth-recovery__hint {
    margin: 0 0 var(--fpm-space-md);
    color: var(--fpm-text-secondary);
    font-size: var(--fpm-font-sm);
    line-height: 1.5;
}

.fpm-auth-recovery__warning {
    color: var(--fpm-status-warn);
}

.fpm-auth-recovery__codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--fpm-space-sm) var(--fpm-space-xl);
    margin: var(--fpm-space-lg) 0;
    padding-left: var(--fpm-space-xl);
}

.fpm-auth-recovery__codes code {
    color: var(--fpm-text-primary);
    font-family: var(--fpm-font-mono);
    font-size: var(--fpm-font-sm);
    overflow-wrap: anywhere;
    user-select: all;
}

.fpm-auth-recovery__tools {
    display: flex;
    gap: var(--fpm-space-sm);
    margin-bottom: var(--fpm-space-lg);
}

.fpm-auth-recovery__button {
    padding: var(--fpm-space-sm) var(--fpm-space-md);
    color: var(--fpm-text-primary);
    background: var(--fpm-bg-surface-raised);
    border: 1px solid var(--fpm-border-strong);
    border-radius: var(--fpm-radius-md);
    cursor: pointer;
    font: inherit;
}

.fpm-auth-recovery__button--primary {
    width: 100%;
    margin-top: var(--fpm-space-md);
    color: var(--fpm-text-inverse);
    background: var(--fpm-accent);
    border-color: var(--fpm-accent);
    font-weight: var(--fpm-weight-semibold);
}

.fpm-auth-recovery__button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.fpm-auth-recovery__acknowledgement {
    display: flex;
    align-items: center;
    gap: var(--fpm-space-sm);
    color: var(--fpm-text-primary);
    cursor: pointer;
    font-size: var(--fpm-font-sm);
}

.fpm-auth-recovery__acknowledgement input {
    width: 18px;
    height: 18px;
}

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 480px) {
    .fpm-auth-page { padding: var(--fpm-space-md); }
    .fpm-auth-card { padding: var(--fpm-space-xl); }
    .fpm-auth-recovery__codes { grid-template-columns: 1fr; }
    .fpm-auth-recovery__tools { flex-direction: column; }
}
