:root {
    --black: #070707;
    --black-soft: #101010;
    --black-card: rgba(15, 15, 15, 0.90);
    --gold: #d8ad45;
    --gold-light: #f3d77d;
    --gold-dark: #8b641f;
    --cream: #f7f1df;
    --muted: #aaa18c;
    --danger: #ff7b7b;
    --border: rgba(225, 184, 82, 0.25);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--cream);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 22%, rgba(214, 171, 67, 0.14), transparent 28rem),
        radial-gradient(circle at 85% 80%, rgba(214, 171, 67, 0.08), transparent 24rem),
        linear-gradient(135deg, #020202 0%, #0c0c0c 55%, #050505 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.17;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, black, transparent);
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
    overflow: hidden;
    border-right: 1px solid rgba(216, 173, 69, 0.12);
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 560px;
    height: 560px;
    border: 1px solid rgba(216, 173, 69, 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 34px rgba(216, 173, 69, 0.025),
        0 0 120px rgba(216, 173, 69, 0.10);
}

.brand-content {
    position: relative;
    z-index: 2;
    width: min(650px, 100%);
    text-align: center;
    animation: rise 700ms ease both;
}

.brand-logo {
    width: min(420px, 78vw);
    max-height: 430px;
    object-fit: contain;
    filter:
        drop-shadow(0 18px 38px rgba(0, 0, 0, 0.55))
        drop-shadow(0 0 24px rgba(216, 173, 69, 0.11));
    user-select: none;
}

.brand-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gold-light);
    background: rgba(216, 173, 69, 0.06);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brand-title {
    margin: 22px auto 12px;
    max-width: 600px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.65rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.brand-title span {
    color: var(--gold-light);
}

.brand-copy {
    max-width: 530px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-wrap {
    width: min(460px, 100%);
    animation: rise 700ms 100ms ease both;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.mobile-brand img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.mobile-brand strong {
    display: block;
    color: var(--gold-light);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.18rem;
}

.mobile-brand small {
    color: var(--muted);
}

.login-card {
    position: relative;
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.008)),
        var(--black-card);
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px);
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    width: 76%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    opacity: 0.65;
}

.eyebrow {
    margin-bottom: 12px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #fffaf0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 2.65rem);
    font-weight: 500;
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 12px 0 30px;
    color: var(--muted);
    line-height: 1.6;
}

.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 123, 123, 0.26);
    border-radius: 13px;
    color: #ffd7d7;
    background: rgba(146, 32, 32, 0.18);
    font-size: 0.92rem;
    line-height: 1.45;
    animation: shake 350ms ease;
}

.alert-success {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid rgba(140, 214, 129, 0.28);
    border-radius: 13px;
    color: #cdf3c6;
    background: rgba(32, 100, 44, 0.18);
    font-size: 0.92rem;
    line-height: 1.45;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: #e8dec4;
    font-size: 0.88rem;
    font-weight: 650;
}

.control {
    position: relative;
}

.control > i {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.05rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 47px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 14px;
    outline: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.045);
    font: inherit;
    transition: 180ms ease;
}

.form-control::placeholder {
    color: #716b5f;
}

.form-control:hover {
    border-color: rgba(216, 173, 69, 0.30);
}

.form-control:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 0 0 4px rgba(216, 173, 69, 0.10);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    color: #bbb19d;
    background: transparent;
    cursor: pointer;
    transition: 160ms ease;
}

.password-toggle:hover {
    color: var(--gold-light);
    background: rgba(216, 173, 69, 0.09);
}

.submit-btn {
    position: relative;
    width: 100%;
    height: 56px;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid #efd477;
    border-radius: 15px;
    color: #130f06;
    background:
        linear-gradient(120deg, #9c7627 0%, #f1d577 42%, #c99732 72%, #f5de8c 100%);
    background-size: 180% 100%;
    box-shadow:
        0 12px 30px rgba(216, 173, 69, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: 200ms ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow:
        0 17px 36px rgba(216, 173, 69, 0.27),
        inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    cursor: wait;
    opacity: 0.78;
}

.button-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: #8e8778;
    font-size: 0.82rem;
}

.security-note i {
    color: var(--gold);
}

.form-links {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.form-links a {
    color: var(--gold-light);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
}

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

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 22px;
    padding: 0 5px;
    color: #716b60;
    font-size: 0.78rem;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
}

@media (max-width: 980px) {
    .page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 30px 22px;
    }

    .mobile-brand {
        display: flex;
    }
}

@media (max-width: 520px) {
    .login-panel {
        align-items: flex-start;
        padding: 24px 16px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .footer {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
