/*
 * Axis Authentication
 * Standalone styling for login, registration, and recovery.
 */

/* ==========================================================
   Theme
   ========================================================== */

body.axis-auth {
    --auth-brand: #f62626;
    --auth-action: #c91e25;
    --auth-action-hover: #ad171e;

    --auth-bg: #f3f3f3;
    --auth-surface: #ffffff;
    --auth-surface-muted: #f5f5f5;

    --auth-text: #292929;
    --auth-heading: #111111;
    --auth-muted: #646464;

    --auth-border: #dddddd;
    --auth-input-border: #929292;

    --auth-link: #ac1820;
    --auth-link-hover: #7e1117;
    --auth-focus: #b71922;
    --auth-soft-red: #fcebed;

    --auth-shadow: 0 12px 36px rgba(0, 0, 0, 0.07);

    color-scheme: light;
}

html.dark-theme body.axis-auth {
    --auth-bg: #161616;
    --auth-surface: #222222;
    --auth-surface-muted: #2b2b2b;

    --auth-text: #ededed;
    --auth-heading: #ffffff;
    --auth-muted: #b7b7b7;

    --auth-border: #414141;
    --auth-input-border: #777777;

    --auth-link: #ff9297;
    --auth-link-hover: #ffc1c4;
    --auth-focus: #ff9297;
    --auth-soft-red: #3a2426;

    --auth-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);

    color-scheme: dark;
}

/* ==========================================================
   Layout
   ========================================================== */

body.axis-auth,
body.axis-auth *,
body.axis-auth *::before,
body.axis-auth *::after {
    box-sizing: border-box;
}

body.axis-auth {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 24px 16px;
    color: var(--auth-text);
    background: var(--auth-bg);
    font-family: "PT Sans", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

.axis-auth .auth-page {
    width: 100%;
    max-width: 480px;
    margin: clamp(8px, 4vh, 40px) auto 0;
}

.axis-auth .auth-card {
    padding: 32px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-top: 4px solid var(--auth-brand);
    border-radius: 14px;
    box-shadow: var(--auth-shadow);
}

/* ==========================================================
   Branding and headings
   ========================================================== */

.axis-auth .auth-header {
    margin-bottom: 26px;
}

.axis-auth .auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: #ffffff;
    border-radius: 5px;
}

.axis-auth .auth-logo {
    display: block;
    width: 144px;
    max-width: 100%;
    height: auto;
    filter: none;
}

.axis-auth h1,
.axis-auth h2 {
    color: var(--auth-heading);
    font-family: "Poppins", Arial, sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.axis-auth .auth-header h1 {
    margin: 20px 0 4px;
    font-size: 20px;
    line-height: 1.4;
}

.axis-auth .subtitle {
    margin: 0;
    color: var(--auth-muted);
    font-size: 15px;
}

.axis-auth #auth-content h2 {
    margin: 0 0 20px;
    font-size: 23px;
    line-height: 1.4;
}

.axis-auth #auth-content p {
    margin: 0 0 18px;
    overflow-wrap: anywhere;
}

/* ==========================================================
   Account navigation
   ========================================================== */

.axis-auth .auth-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 28px;
    padding: 5px;
    background: var(--auth-surface-muted);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
}

.axis-auth .auth-nav button {
    min-height: 42px;
    padding: 9px 10px;
    color: var(--auth-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 15px;
}

.axis-auth .auth-nav button:hover {
    color: var(--auth-text);
    background: var(--auth-surface);
}

.axis-auth .auth-nav button[aria-current="true"] {
    color: var(--auth-link);
    background: var(--auth-surface);
    border-color: var(--auth-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* ==========================================================
   Forms
   ========================================================== */

.axis-auth form {
    margin: 0;
}

.axis-auth label {
    display: block;
    margin: 16px 0 6px;
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 700;
}

.axis-auth input:not([type="hidden"]) {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--auth-text);
    background: var(--auth-surface);
    border: 1px solid var(--auth-input-border);
    border-radius: 7px;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
}

.axis-auth input:not([type="hidden"]):focus {
    border-color: var(--auth-focus);
    box-shadow: 0 0 0 3px var(--auth-soft-red);
}

.axis-auth input::placeholder {
    color: var(--auth-muted);
    opacity: 1;
}

.axis-auth input[name="pin"] {
    font-family: "Courier New", Courier, monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-align: center;
}

.axis-auth .hint {
    margin: 12px 0 0 !important;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

/* ==========================================================
   Buttons
   ========================================================== */

.axis-auth button {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    font: inherit;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition:
            background-color 150ms ease,
            border-color 150ms ease,
            color 150ms ease;
}

.axis-auth button.primary {
    width: 100%;
    margin-top: 24px;
    color: #ffffff;
    background: var(--auth-action);
    border-color: var(--auth-action);
}

.axis-auth button.primary:hover {
    background: var(--auth-action-hover);
    border-color: var(--auth-action-hover);
}

.axis-auth button.secondary {
    color: var(--auth-text);
    background: var(--auth-surface-muted);
    border-color: var(--auth-border);
}

/* Navigation uses its own compact secondary-button appearance. */
.axis-auth .auth-nav button.secondary {
    color: var(--auth-muted);
    background: transparent;
    border-color: transparent;
}

.axis-auth .auth-nav button.secondary[aria-current="true"] {
    color: var(--auth-link);
    background: var(--auth-surface);
    border-color: var(--auth-border);
}

.axis-auth .form-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.axis-auth .form-links button {
    min-height: 44px;
    margin: 0;
    padding: 8px 10px;
    color: var(--auth-link);
    background: transparent;
    border-color: transparent;
    font-size: 14px;
}

.axis-auth .form-links button:hover {
    color: var(--auth-link-hover);
    background: var(--auth-soft-red);
}

.axis-auth button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ==========================================================
   Messages
   ========================================================== */

/*
 * Keep the live region present when empty, but do not reserve
 * the large blank space from the previous design.
 */
.axis-auth #auth-message {
    min-height: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.axis-auth #auth-message:not(:empty) {
    margin-bottom: 22px;
    padding: 12px 14px;
    color: var(--auth-text);
    background: var(--auth-surface-muted);
    border: 1px solid var(--auth-border);
    border-left: 3px solid var(--auth-brand);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.axis-auth .auth-noscript {
    margin-top: 20px;
    color: var(--auth-text);
}

/* ==========================================================
   Footer and focus
   ========================================================== */

.axis-auth .auth-footer {
    padding: 22px 12px 8px;
    text-align: center;
    font-size: 14px;
}

.axis-auth .auth-footer a {
    color: var(--auth-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.axis-auth .auth-footer a:hover {
    color: var(--auth-link-hover);
}

.axis-auth .auth-footer p {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
}

.axis-auth :is(a, button, input):focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 3px;
}

/* ==========================================================
   Small screens
   ========================================================== */

@media (max-width: 480px) {
    body.axis-auth {
        padding: 16px 12px;
    }

    .axis-auth .auth-page {
        margin-top: 0;
    }

    .axis-auth .auth-card {
        padding: 24px 20px;
        border-radius: 11px;
    }

    .axis-auth .auth-nav {
        margin-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .axis-auth button {
        transition: none;
    }
}