/* ============================================================
   MWARE.STOCKA — AUTH SCREENS
   Premium split-screen sign-in / register / password flows.
   Theme-aware: every colour derives from the token layer
   (theme.css + themes.css), so all four themes work for free.
   Loaded LAST in _AuthLayout so it wins over legacy site.css.
   ============================================================ */

body.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--app-bg);
    /* subtle brand wash behind the card */
    background-image:
        radial-gradient(1100px 600px at 12% -10%, var(--brand-tint) 0%, transparent 55%),
        radial-gradient(900px 500px at 100% 110%, var(--brand-tint) 0%, transparent 50%);
}

:root[data-theme="dark"] body.auth-page {
    background-image:
        radial-gradient(1100px 600px at 12% -10%, rgba(45, 212, 191, 0.10) 0%, transparent 55%),
        radial-gradient(900px 500px at 100% 110%, rgba(45, 212, 191, 0.08) 0%, transparent 50%);
}

/* ===== The card / shell ===== */
.auth-shell {
    position: relative;
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 620px;
}

/* ===== Left: brand / marketing panel ===== */
.auth-brand {
    position: relative;
    padding: 44px 42px;
    color: #fff;
    display: flex;
    flex-direction: column;
    background: linear-gradient(155deg, var(--brand) 0%, var(--brand-700) 55%, var(--brand-800) 100%);
    overflow: hidden;
    isolation: isolate;
}

/* decorative glows */
.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: -1;
    filter: blur(2px);
}

.auth-brand::before {
    width: 340px;
    height: 340px;
    top: -120px;
    right: -110px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
}

.auth-brand::after {
    width: 260px;
    height: 260px;
    bottom: -90px;
    left: -80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
}

.auth-brand__logo {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.auth-brand__logo img {
    height: 54px;
    width: auto;
    display: block;
    /* subtle lift so the white mark reads on the brand gradient */
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.auth-brand__pill {
    margin-top: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}

.auth-brand__pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b9f8e6;
    box-shadow: 0 0 0 4px rgba(185, 248, 230, 0.25);
}

.auth-brand h2 {
    color: #fff;
    font-size: 32px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 20px 0 12px;
}

.auth-brand p.lead {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    max-width: 40ch;
    margin: 0;
}

.auth-brand__features {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.auth-brand__features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.94);
}

.auth-brand__features .tick {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-brand__features .tick svg {
    width: 15px;
    height: 15px;
}

.auth-brand__foot {
    margin-top: auto;
    padding-top: 30px;
    display: flex;
    gap: 26px;
}

.auth-brand__stat .n {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-brand__stat .l {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

/* ===== Right: form panel ===== */
.auth-main {
    padding: 44px 46px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.auth-main__head {
    margin-bottom: 26px;
}

.auth-main__head h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: var(--ink-900);
}

.auth-main__head p {
    margin: 0;
    color: var(--ink-500);
    font-size: 14px;
}

/* Form primitives (scoped to auth so we don't disturb the dashboard) */
.auth-main .form-group {
    margin-bottom: 18px;
}

.auth-main .form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
}

.auth-main .form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 14.5px;
    color: var(--ink-900);
    background: var(--surface-1);
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm, 10px);
    transition: border-color .18s, box-shadow .18s, background .18s;
    box-sizing: border-box;
    font-family: var(--font);
}

.auth-main .form-input::placeholder {
    color: var(--ink-400);
}

.auth-main .form-input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--brand-ring);
}

/* password field + eye toggle */
.auth-main .password-wrapper {
    position: relative;
}

.auth-main .password-wrapper .form-input {
    padding-right: 46px;
}

.auth-main .toggle-password {
    position: absolute;
    right: 6px;
    top: 33px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    user-select: none;
    color: var(--ink-500);
    transition: background .15s;
}

.auth-main .toggle-password:hover {
    background: var(--surface-2);
}

.auth-main .error-message,
.auth-main .field-validation-error,
.auth-main .text-danger {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 500;
}

/* Buttons */
.auth-main .btn-primary,
.auth-main .btn-full-width {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--r-sm, 10px);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
    box-shadow: 0 8px 20px var(--brand-ring);
    transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
    margin-top: 6px;
}

.auth-main .btn-primary:hover,
.auth-main .btn-full-width:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 12px 26px var(--brand-ring);
}

.auth-main .btn-primary:active,
.auth-main .btn-full-width:active {
    transform: translateY(0);
}

/* Secondary link row */
.auth-links {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    color: var(--ink-500);
}

.auth-links a {
    color: var(--brand-700);
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links .sep {
    color: var(--line);
}

/* Status / confirmation screens (RegisterStatus, ForgotPasswordStatus, ConfirmEmail) */
.auth-status {
    text-align: center;
    padding: 8px 0;
}

.auth-status__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--success-bg);
    color: var(--success);
}

.auth-status__icon svg { width: 36px; height: 36px; }

.auth-status h1 {
    font-size: 22px;
    margin: 0 0 10px;
    color: var(--ink-900);
}

.auth-status p {
    color: var(--ink-600);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 42ch;
    margin: 0 auto 24px;
}

/* Theme switcher placement inside the shell */
.auth-shell .theme-switch {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
    body.auth-page {
        padding: 0;
        align-items: stretch;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin: 0 auto;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .auth-brand {
        padding: 28px 26px 26px;
    }

    /* On mobile keep the brand header compact — hide the long sell */
    .auth-brand__features,
    .auth-brand__foot {
        display: none;
    }

    .auth-brand h2 {
        font-size: 24px;
        margin: 16px 0 8px;
    }

    .auth-brand__pill {
        margin-top: 18px;
    }

    .auth-main {
        padding: 30px 24px 40px;
    }

    .auth-shell .theme-switch {
        top: 14px;
        right: 14px;
    }
}

@media (max-width: 420px) {
    .auth-brand p.lead { font-size: 14px; }
    .auth-main__head h1 { font-size: 21px; }
}
