/*
 * RollWithIt — Authentication Shell
 * Phase 3.2D
 *
 * Shared presentation layer for authentication-family pages:
 * Login / Register / Forgot Password / Reset Password.
 *
 * This file intentionally contains presentation only.
 * No game logic or JavaScript depends on these selectors.
 */

/* ---------------------------------------------------------
   Page foundation
   --------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(76, 133, 199, .10),
            transparent 28rem
        ),
        var(--ui-color-bg, #0b1119);

    color: var(--ui-color-text, #f4eee5);

    font-family:
        var(
            --ui-font-sans,
            Inter,
            ui-sans-serif,
            system-ui,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif
        );
}

/* ---------------------------------------------------------
   Basic text / links
   --------------------------------------------------------- */

a {
    color: var(--ui-color-accent-bright, #e2b06f);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-shell h1,
.auth-shell h2 {
    font-family:
        var(
            --ui-font-display,
            Georgia,
            "Times New Roman",
            serif
        );
}

.auth-shell h1 {
    margin: .6rem 0 1.5rem;

    font-size: clamp(2.6rem, 5vw, 5.8rem);
    font-weight: 500;
    line-height: .98;
}

.auth-shell h2 {
    margin: .4rem 0;

    font-size: 2rem;
    font-weight: 500;
}

.auth-shell .eyebrow {
    color: var(--ui-color-accent-bright, #e2b06f);

    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .18em;
}

.auth-shell .lead {
    max-width: 44rem;

    color: #c6cfdb;

    font-size: 1.12rem;
    line-height: 1.65;
}

.auth-shell .muted {
    color: var(--ui-color-text-muted, #aeb8c7);
    line-height: 1.55;
}

/* ---------------------------------------------------------
   Two-panel authentication layout
   --------------------------------------------------------- */

.auth-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns: 1.05fr .95fr;
}

.auth-shell .brand-panel,
.auth-shell .auth-panel {
    padding: clamp(2rem, 7vw, 7rem);

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-shell .brand-panel {
    border-right: 1px solid var(--ui-color-border, #3a332c);

    background:
        linear-gradient(
            135deg,
            rgba(76, 133, 199, .075),
            transparent 45%
        ),
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, .012) 0 1px,
            transparent 1px 9px
        );
}

.auth-shell .auth-panel {
    align-items: center;
}

.auth-shell .auth-card {
    width: min(100%, 430px);
}

/* ---------------------------------------------------------
   System marks
   --------------------------------------------------------- */

.auth-shell .brand-system-marks {
    margin-bottom: 24px;

    display: flex;
    align-items: center;
    gap: 34px;
}

.auth-shell .brand-system-marks .brand-mark {
    margin: 0;
}

.auth-shell .brand-mark {
    width: 64px;
    height: 64px;

    border: 1px solid var(--ui-color-accent, #c88748);

    display: grid;
    place-items: center;

    color: var(--ui-color-accent-bright, #e2b06f);

    font-family:
        var(--ui-font-display, Georgia, serif);

    font-size: 1.5rem;
    font-weight: 700;

    transform: rotate(45deg);

    /* Legacy parity for single-mark auth pages. */
    margin-bottom: 2rem;
}

.auth-shell .brand-mark.small {
    width: 48px;
    height: 48px;

    font-family: inherit;
}

.auth-shell .rune-line {
    width: 7rem;
    height: 1px;

    margin: 2rem 0;

    background: var(--ui-color-accent, #c88748);
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */

.auth-shell form {
    margin-top: 2rem;

    display: grid;
    gap: 1rem;
}

.auth-shell label {
    display: grid;
    gap: .55rem;

    color: #cbd3dd;

    font-size: .82rem;
    font-weight: 700;
}

.auth-shell input {
    width: 100%;

    padding: .95rem 1rem;

    border: 1px solid var(--ui-color-border, #3a332c);
    border-radius: var(--ui-radius-control, 8px);

    background: #0d1621;
    color: var(--ui-color-text, #f4eee5);

    font: inherit;
    outline: none;
}

.auth-shell input:focus {
    border-color: var(--ui-color-accent, #c88748);

    box-shadow:
        0 0 0 3px rgba(200, 135, 72, .10);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.auth-shell button {
    padding: .95rem 1.1rem;

    border: 0;
    border-radius: var(--ui-radius-control, 8px);

    font: inherit;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform var(--ui-motion-fast, 160ms)
            var(--ui-motion-ease, cubic-bezier(.2,.8,.2,1)),
        border-color var(--ui-motion-fast, 160ms) ease,
        box-shadow var(--ui-motion-fast, 160ms) ease,
        background-color var(--ui-motion-fast, 160ms) ease,
        color var(--ui-motion-fast, 160ms) ease,
        opacity var(--ui-motion-fast, 160ms) ease;
}

.auth-shell button:hover {
    transform: translateY(-1px);
}

.auth-shell button:active {
    transform: translateY(0) scale(.985);
}

.auth-shell .primary {
    background:
        linear-gradient(
            180deg,
            var(--ui-color-accent-bright, #e2b06f),
            var(--ui-color-accent, #c88748)
        );

    color: #1b130d;
}

.auth-shell .primary:hover {
    filter: brightness(1.06);
}

.auth-shell .primary:disabled {
    opacity: .45;
    cursor: default;
}

/* ---------------------------------------------------------
   Authentication messages / footer links
   --------------------------------------------------------- */

.auth-shell .switch {
    margin-top: 1.5rem;

    color: var(--ui-color-text-muted, #aeb8c7);
    text-align: center;
}

.auth-shell .alert {
    margin-top: 1.2rem;
    padding: .85rem 1rem;

    border: 1px solid rgba(216, 120, 108, .45);
    border-radius: var(--ui-radius-control, 8px);

    background: rgba(216, 120, 108, .10);
    color: #ffd9d4;
}

.auth-shell .success-alert {
    margin-top: 1.2rem;
    padding: .85rem 1rem;

    border: 1px solid rgba(92, 190, 126, .45);
    border-radius: var(--ui-radius-control, 8px);

    background: rgba(92, 190, 126, .10);
    color: #d8ffe4;

    line-height: 1.5;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-shell .brand-panel {
        min-height: 42vh;

        border-right: 0;
        border-bottom:
            1px solid var(--ui-color-border, #3a332c);
    }

    .auth-shell .brand-panel,
    .auth-shell .auth-panel {
        padding: 2rem 1.25rem;
    }

    .auth-shell .auth-panel {
        min-height: 58vh;
    }

    .auth-shell .brand-panel h1 {
        font-size: 2.8rem;
    }
}

/* =========================================================
   Phase 3.3B — shared auth back control

   Used by Register / recovery-family pages.
   Presentation only. Navigation behavior remains owned by
   core/site-shell.js via data-ui-nav="back".
   ========================================================= */

.auth-back.back-button-large {
    position: fixed;

    top: 18px;
    left: 22px;

    z-index: 30;

    width: 58px;
    min-width: 58px;
    max-width: 58px;

    height: 58px;
    min-height: 58px;
    max-height: 58px;

    flex: 0 0 58px;

    padding: 0 !important;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(226, 160, 77, .30) !important;

    border-radius: 11px;

    background: #0d1a29 !important;
    background-color: #0d1a29 !important;

    color:
        var(--ui-color-accent-bright, #e2b06f);

    text-decoration: none;

    font-size: 2rem;
    line-height: 0;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.auth-back.back-button-large:hover {
    border-color:
        rgba(226, 160, 77, .52) !important;

    background: #203a59 !important;
    background-color: #203a59 !important;

    text-decoration: none;

    transform: translateX(-1px);
}

.auth-back.back-button-large .back-arrow {
    position: relative;

    width: 25px;
    height: 2px;

    display: block;

    border-radius: 999px;

    background:
        var(--ui-color-accent-bright, #e2b06f);

    transform: none;
}

.auth-back.back-button-large .back-arrow::before,
.auth-back.back-button-large .back-arrow::after {
    content: "";

    position: absolute;
    left: 0;

    width: 11px;
    height: 2px;

    border-radius: 999px;

    background:
        var(--ui-color-accent-bright, #e2b06f);

    transform-origin: left center;
}

.auth-back.back-button-large .back-arrow::before {
    top: 0;
    transform: rotate(42deg);
}

.auth-back.back-button-large .back-arrow::after {
    bottom: 0;
    transform: rotate(-42deg);
}

@media (max-width: 640px) {
    .auth-back.back-button-large {
        top: 14px;
        left: 14px;

        width: 46px;
        min-width: 46px;
        max-width: 46px;

        height: 46px;
        min-height: 46px;
        max-height: 46px;

        flex-basis: 46px;

        font-size: 1.6rem;
    }

    .auth-back.back-button-large .back-arrow {
        width: 22px;
    }

    .auth-back.back-button-large .back-arrow::before,
    .auth-back.back-button-large .back-arrow::after {
        width: 10px;
    }
}

