:root {
    --gold: #e8bd58;
    --gold-light: #ffe4a0;
    --gold-dark: #a97720;
    --cream: #fff4df;
    --maroon: #3b0305;
}
* {
    box-sizing: border-box;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 18px;
}
.login-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto;
}
.brand-section {
    text-align: center;
    margin-bottom: 24px;
}
.brand-logo {
    display: block;
    width: min(290px, 85%);
    max-height: 125px;
    object-fit: contain;
    margin: 0 auto;
}
.brand-fallback {
    color: var(--gold);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(40px, 8vw, 64px);
    font-weight: 700;
    line-height: 1;
}
.brand-caption {
    color: var(--gold-light);
    font-size: 9px;
    letter-spacing: 3px;
    margin-top: 8px;
}
.login-card {
    position: relative;
    padding: 30px 32px;
    border: 1px solid rgba(232, 189, 88, 0.95);
    border-radius: 22px;
    background: linear-gradient(
        145deg,
        rgba(63, 5, 7, 0.86),
        rgba(39, 2, 3, 0.91)
    );
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.22),
        inset 0 0 30px rgba(232, 189, 88, 0.025);
    backdrop-filter: blur(8px);
}
.ornament {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 12px;
    color: var(--gold);
    background: #430507;
    font-size: 17px;
    line-height: 1;
}
.ornament-top {
    top: -9px;
}
.ornament-bottom {
    bottom: -9px;
}
.login-title {
    margin: 0;
    color: var(--gold-light);
    font-family: "Cormorant Garamond", serif;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}
.login-subtitle {
    margin: 4px 0 23px;
    color: #dfc89b;
    font-size: 12px;
    text-align: center;
}
.form-control-wrap {
    position: relative;
    margin-bottom: 12px;
}
.form-control-wrap > .field-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 14px;
    pointer-events: none;
}
.login-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    border: 1px solid rgba(205, 153, 54, 0.35);
    border-radius: 8px;
    outline: none;
    color: #fff5e2;
    background: rgba(35, 0, 2, 0.36);
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    transition:
        border-color 0.25s,
        box-shadow 0.25s;
}
.login-input::placeholder {
    color: #b49b86;
    opacity: 1;
}
.login-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(232, 189, 88, 0.09);
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    border: 0;
    color: var(--gold-light);
    background: transparent;
    cursor: pointer;
}
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 15px 0 20px;
    font-size: 11px;
}
.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ead8bc;
    cursor: pointer;
}
.remember-label input {
    width: 14px;
    height: 14px;
    accent-color: var(--gold);
}
.forgot-link {
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
}
.forgot-link:hover,
.register-link:hover {
    color: var(--gold-light);
}
.login-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid #f1ca70;
    border-radius: 8px;
    color: #4a1208;
    background: linear-gradient(180deg, #ffe4a0, #eeb954);
    font-family: "Cormorant Garamond", serif;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition:
        transform 0.2s,
        filter 0.2s;
}
.login-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}
.login-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #e6d1b2;
    font-size: 11px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(214, 173, 87, 0.2);
}
.register-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    width: 100%;
    border: 1px solid rgba(218, 170, 63, 0.65);
    border-radius: 8px;
    color: var(--gold);
    background: rgba(35, 0, 2, 0.2);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.register-link:hover {
    background: rgba(232, 189, 88, 0.08);
}
.login-footer {
    margin-top: 18px;
    color: rgba(255, 228, 160, 0.7);
    font-size: 10px;
    text-align: center;
    letter-spacing: 0.5px;
}
.alert {
    font-size: 12px;
    border-radius: 8px;
}
@media (max-width: 576px) {
    body {
        background-attachment: scroll;
        background-position: center;
    }
    .login-page {
        padding: 24px 15px;
    }
    .login-wrapper {
        max-width: 390px;
    }
    .brand-section {
        margin-bottom: 20px;
    }
    .brand-logo {
        width: min(235px, 80%);
        max-height: 100px;
    }
    .login-card {
        padding: 28px 21px;
        border-radius: 17px;
    }
    .login-title {
        font-size: 29px;
    }
    .login-subtitle {
        font-size: 11px;
    }
    .login-options {
        font-size: 10px;
    }
}
@media (max-height: 650px) and (min-width: 577px) {
    .login-page {
        padding-top: 18px;
        padding-bottom: 18px;
    }
    .brand-section {
        margin-bottom: 14px;
    }
    .brand-logo {
        max-height: 90px;
    }
    .login-card {
        padding-top: 23px;
        padding-bottom: 23px;
    }
    .login-subtitle {
        margin-bottom: 16px;
    }
}
/* Chrome, Edge, Safari autofill styling */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-text-fill-color: #fff5e2 !important;
    caret-color: #fff5e2;

    -webkit-box-shadow: 0 0 0 1000px #3b0808 inset !important;
    box-shadow: 0 0 0 1000px #3b0808 inset !important;

    border: 1px solid rgba(205, 153, 54, 0.45) !important;
    transition: background-color 99999s ease-in-out 0s;
}

/* Keep the same colors when autofilled fields receive focus */
.login-input:-webkit-autofill:focus {
    border-color: #e8bd58 !important;
    -webkit-box-shadow:
        0 0 0 1000px #3b0808 inset,
        0 0 0 3px rgba(232, 189, 88, 0.09) !important;
}

/* Firefox autofill */
.login-input:autofill {
    color: #fff5e2 !important;
    background-color: #3b0808 !important;
}