/*
 * Shared stylesheet of the public account pages (task.md 10.2): access code,
 * accept invite, verify e-mail, forgot password, resend verification and
 * reset password.
 *
 * The <body> class says which page layout applies (Frontend/auth_base.html):
 *   auth-page     every page (redesigned on 2026-11-05, owner request), with
 *     auth-access   the access-code gate (since 2026-11-05 in the same card)
 *     auth-form     forgot password, resend verification, reset password
 *     auth-invite   accept an invite
 *     auth-verify   e-mail verification result
 * The redesigned pages share one card: the brand, a round icon, a title, the
 * text, fields with a pink focus ring, full-width outline buttons (pink text,
 * no pink fill, like the /manage pages), messages as coloured callouts and
 * small links below. Rules without a page class are shared by all pages.
 */

:root {
    --bg-1: #0b1021;
    --bg-2: #111827;
    --accent: #f8b5d6;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --success: #10b981;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, rgba(248,181,214,0.1), transparent 30%),
                radial-gradient(circle at 80% 0%, rgba(59,130,246,0.08), transparent 28%),
                linear-gradient(135deg, var(--bg-1), var(--bg-2));
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    padding: 20px;
}

.card {
    width: min(520px, 100%);
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
}

/* "Asset Archive" above the card's content (restyled under .auth-page) */
.brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.muted { color: var(--muted); }

/* ---- The pages (access code / forgot / resend / reset / verify / invite) ---- */

.auth-page .card {
    width: min(460px, 100%);
    padding: 30px 32px 26px;
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.92);
}

.auth-page .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--accent);
    font-size: 15px;
    letter-spacing: 0.02em;
}

.auth-page .brand::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(248, 181, 214, 0.6);
}

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border: 1px solid rgba(248, 181, 214, 0.4);
    border-radius: 50%;
    background: rgba(248, 181, 214, 0.1);
    color: var(--accent);
}

.auth-icon svg {
    width: 24px;
    height: 24px;
}

.auth-icon.is-success {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.auth-icon.is-info {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.auth-icon.is-danger {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.auth-page .title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
}

.auth-page .muted,
.auth-page .message,
.auth-page .note {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
}

.auth-page .message {
    color: var(--text);
    font-size: 15px;
}

.auth-page .note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.auth-page .strong {
    color: var(--text);
}

.pill {
    display: block;
    width: fit-content;
    margin-bottom: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pill.is-success {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

/* Fields */
.auth-page form {
    display: grid;
    gap: 14px;
}

.auth-page .field {
    display: grid;
    gap: 6px;
}

.auth-page label {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.auth-page input[type="email"],
.auth-page input[type="password"],
.auth-page input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #374151;
    border-radius: 10px;
    background: #0b1220;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page input::placeholder {
    color: #6b7280;
}

.auth-page input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(248, 181, 214, 0.18);
}

.auth-page input[readonly] {
    color: var(--muted);
}

.auth-page input:disabled {
    opacity: 0.6;
}

.auth-page .hint {
    color: #6b7280;
    font-size: 12px;
}

/* Buttons: full width, the outline style of the /manage pages. */
.auth-page .actions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.auth-page .btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(248, 181, 214, 0.6);
    border-radius: 10px;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-page .btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(248, 181, 214, 0.12);
}

.auth-page .btn:focus-visible,
.auth-page .auth-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-page .btn:disabled {
    border-color: #4b5563;
    color: #6b7280;
    cursor: not-allowed;
}

/* Messages: coloured callouts (shown by js/auth.js). */
.auth-page .error,
.auth-page .success,
.auth-page .form-error,
.auth-page .form-success {
    display: none;
    padding: 10px 12px;
    border-left: 3px solid;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-page .form-error:not(:empty),
.auth-page .form-success:not(:empty),
.auth-page .error.is-shown {
    display: block;
}

.auth-page .error.is-shown {
    margin-bottom: 16px;
}

.auth-page .error,
.auth-page .form-error {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.auth-page .success,
.auth-page .form-success {
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

/* Reset password: after a successful reset only the message and "log in" stay. */
.auth-page .done-only {
    display: none;
}

#resetForm.is-done .field,
#resetForm.is-done #submitBtn {
    display: none;
}

#resetForm.is-done .done-only {
    display: block;
}

/* Small links below the card's content */
.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.auth-links a {
    color: var(--muted);
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--accent);
}

/* Access code: big, evenly spaced digits */
.auth-page .code-input {
    padding: 14px;
    font-size: 26px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.18em;
    text-align: center;
}

.auth-page .code-input::placeholder {
    letter-spacing: 0.18em;
}

/* Invite: who invited, for which address, until when */
.auth-page .meta {
    display: grid;
    gap: 6px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 13px;
}

.auth-page .meta strong {
    color: var(--text);
    font-weight: 600;
}

@media (max-width: 480px) {
    .auth-page .card {
        padding: 24px 20px 20px;
    }
}
