@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --auth-gold: #c9a227;
    --auth-gold-light: #e8c547;
    --auth-black: #0d0d0d;
    --auth-dark: #1a1a1a;
    --auth-gray-100: #f5f5f5;
    --auth-gray-200: #e8e8e8;
    --auth-gray-600: #6b6b6b;
    --auth-radius: 14px;
    --auth-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    color: var(--auth-black);
    isolation: isolate;
}

/* Pure CSS background — no photo */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(165deg, #080808 0%, #121212 42%, #0a0a0a 100%);
}

.auth-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 15% 20%, rgba(201, 162, 39, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 50% 45% at 85% 75%, rgba(201, 162, 39, 0.09) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
    pointer-events: none;
}

.auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(201, 162, 39, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 162, 39, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 20%, transparent 75%);
    pointer-events: none;
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(125deg, transparent 40%, rgba(201, 162, 39, 0.04) 50%, transparent 60%),
        linear-gradient(215deg, transparent 55%, rgba(201, 162, 39, 0.03) 62%, transparent 70%);
    pointer-events: none;
}

.auth-page::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10;
    background: linear-gradient(90deg, transparent, var(--auth-gold), transparent);
    pointer-events: none;
}

/* Top bar */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 39, 0.45);
    background: rgba(201, 162, 39, 0.1);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-gold-light);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.auth-back:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--auth-gold-light);
    color: #fff;
}

.auth-topbar__badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* Split layout */
.auth-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    gap: 2rem;
}

.auth-aside {
    display: none;
}

.auth-aside__inner {
    max-width: 420px;
}

.auth-aside__logo {
    height: 72px;
    width: auto;
    margin-bottom: 1.25rem;
    display: block;
}

.auth-aside__tag {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    background: rgba(201, 162, 39, 0.1);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-gold-light);
}

.auth-aside__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.auth-aside__text {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.68);
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
}

.auth-features i {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.15);
    color: var(--auth-gold-light);
    font-size: 0.9rem;
}

/* Main / card */
.auth-main {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    position: relative;
    border-radius: 20px;
    padding: 2rem 1.75rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(201, 162, 39, 0.22);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-gold), var(--auth-gold-light), var(--auth-gold));
}

.auth-card__head {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--auth-black);
}

.auth-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--auth-gray-600);
}

/* Alert */
.auth-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--auth-radius);
    border: 1px solid rgba(201, 62, 39, 0.3);
    background: rgba(201, 62, 39, 0.07);
    color: #991b1b;
    font-size: 0.875rem;
}

.auth-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.auth-alert ul {
    font-size: 0.8rem;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-black);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--auth-gold);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.auth-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-gray-200);
    background: var(--auth-gray-100);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--auth-black);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder {
    color: rgba(107, 107, 107, 0.75);
}

.auth-input:focus {
    outline: none;
    border-color: rgba(201, 162, 39, 0.6);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.auth-input-wrap:has(.auth-toggle-pw) .auth-input {
    padding-right: 2.75rem;
}

.auth-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.auth-toggle-pw {
    position: absolute;
    right: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-gray-600);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-pw:hover {
    color: var(--auth-gold);
    background: rgba(201, 162, 39, 0.1);
}

.auth-field-error {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #dc2626;
}

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--auth-gray-600);
    user-select: none;
}

.auth-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-gold);
    cursor: pointer;
}

.auth-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-gold);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--auth-black);
    text-decoration: underline;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--auth-gold);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--auth-gold), var(--auth-gold-light));
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--auth-black);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(201, 162, 39, 0.45);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-footer {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Override layout wrappers */
body.auth main.py-4 {
    padding: 0 !important;
    min-height: 100vh;
    display: block;
}

body.auth #app {
    min-height: 100vh;
}

/* Desktop split */
@media (min-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr 440px;
        gap: 3rem;
        padding-bottom: 3rem;
    }

    .auth-aside {
        display: block;
    }

    .auth-main {
        margin: 0;
        max-width: none;
    }

    .auth-card__head {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .auth-topbar {
        padding: 0.75rem 1rem;
    }

    .auth-layout {
        padding: 0 1rem 1.5rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-title {
        font-size: 1.45rem;
    }

    .auth-topbar__badge {
        display: none;
    }
}
