:root {
    --tdp-navy: #0b192c;
    --tdp-navy-light: #1e2e45;
    --tdp-gold: #d4af37;
    --tdp-gold-dark: #8a6d12;
    --tdp-text: #1f2937;
    --tdp-muted: #64748b;
    --tdp-border: #dbe2ea;
    --tdp-bg: #f8fafc;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    display: block;
    margin: 0;
    color: var(--tdp-text);
    background:
        radial-gradient(circle at 90% 12%, rgba(212, 175, 55, 0.1), transparent 28rem),
        var(--tdp-bg);
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.tdp-login-brand {
    position: relative;
    display: flex;
    min-height: 220px;
    padding: 1.5rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    color: #e2e8f0;
    background:
        linear-gradient(145deg, rgba(11, 25, 44, 0.96), rgba(30, 46, 69, 0.98)),
        var(--tdp-navy);
}

.tdp-login-brand::before,
.tdp-login-brand::after {
    position: absolute;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 50%;
}

.tdp-login-brand::before {
    width: 19rem;
    height: 19rem;
    top: -12rem;
    right: -8rem;
}

.tdp-login-brand::after {
    width: 13rem;
    height: 13rem;
    right: -7rem;
    bottom: -9rem;
    box-shadow: 0 0 0 2.5rem rgba(212, 175, 55, 0.035);
}

.tdp-login-identity {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.8rem;
    color: #fff;
    text-decoration: none;
}

.tdp-login-identity:hover,
.tdp-login-identity:focus {
    color: #fff;
}

.tdp-login-crest {
    display: block;
    width: auto;
    height: 58px;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.3));
}

.tdp-login-identity strong {
    display: block;
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tdp-login-identity small {
    display: block;
    margin-top: 0.25rem;
    color: var(--tdp-gold);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.tdp-login-brand-copy {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
}

.tdp-login-brand-copy p {
    margin: 0;
}

.tdp-login-brand-copy .tdp-login-eyebrow {
    color: var(--tdp-gold);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tdp-login-brand-copy .tdp-login-title {
    max-width: 31rem;
    margin: 0.45rem 0 0.5rem;
    color: #fff;
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.45rem, 6vw, 2.2rem);
    font-weight: 700;
    line-height: 1.2;
}

.tdp-login-brand-copy > p:last-child,
.tdp-login-since {
    color: #aebbc9;
}

.tdp-login-brand-copy > p:last-child {
    display: none;
    max-width: 31rem;
    font-size: 0.92rem;
}

.tdp-login-since {
    position: relative;
    z-index: 1;
    display: none;
    margin: 2rem 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-main {
    display: flex;
    width: 100%;
    padding: 1.25rem 1rem 2rem;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    border: 1px solid rgba(219, 226, 234, 0.9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

.login-intro {
    margin-bottom: 1.4rem;
}

.login-intro > span {
    display: flex;
    margin-bottom: 0.35rem;
    align-items: center;
    gap: 0.4rem;
    color: var(--tdp-gold-dark);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-intro h1 {
    margin: 0;
    color: var(--tdp-navy);
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.65rem, 7vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
}

.login-intro p {
    margin: 0.55rem 0 0;
    color: var(--tdp-muted);
    font-size: 0.88rem;
}

.form-field {
    margin-bottom: 1rem;
}

.form-label {
    margin-bottom: 0.4rem;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--tdp-border);
    border-radius: 8px;
    color: var(--tdp-text);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:hover {
    border-color: #aab7c6;
}

.form-control:focus {
    border-color: var(--tdp-gold-dark);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 3px;
    right: 4px;
    display: inline-flex;
    width: 42px;
    height: 42px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    color: var(--tdp-muted);
    background: transparent;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--tdp-navy);
    background: #f8fafc;
    outline: 0;
}

.login-links a {
    color: #526173;
    font-weight: 600;
    text-decoration: none;
}

.login-links a:hover,
.login-links a:focus {
    color: var(--tdp-gold-dark);
}

.forgot-link {
    margin: -0.1rem 0 1rem;
    text-align: right;
    font-size: 0.85rem;
}

.btn-login {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    padding: 0.55rem 1.25rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--tdp-gold);
    border-radius: 8px;
    color: var(--tdp-navy);
    background: var(--tdp-gold);
    font-family: inherit;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.24);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover,
.btn-login:focus {
    border-color: #b89320;
    color: var(--tdp-navy);
    background: #c9a42f;
    box-shadow: 0 10px 22px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.back-link {
    margin-top: 1.2rem;
    text-align: center;
    font-size: 0.82rem;
}

.alert {
    margin-bottom: 1rem;
    padding: 0.8rem 2.5rem 0.8rem 0.9rem;
    border: 0;
    border-left: 4px solid var(--tdp-gold);
    border-radius: 6px;
    font-size: 0.82rem;
    box-shadow: none;
}

.alert-danger {
    border-left-color: #dc2626;
    color: #7f1d1d;
    background: #fef2f2;
}

.alert-success {
    border-left-color: #16a34a;
    color: #14532d;
    background: #f0fdf4;
}

@media (min-width: 720px) {
    .tdp-login-brand {
        min-height: 260px;
        padding: 2rem 3rem;
    }

    .tdp-login-brand-copy > p:last-child {
        display: block;
    }

    .login-main {
        padding: 2rem;
    }

    .login-container {
        padding: 2rem;
    }
}

@media (min-width: 960px) {
    body {
        display: grid;
        min-height: 100vh;
        min-height: 100dvh;
        grid-template-columns: minmax(390px, 0.9fr) minmax(500px, 1.1fr);
        align-items: center;
    }

    .tdp-login-brand {
        position: sticky;
        top: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 620px;
        padding: clamp(2.5rem, 5vw, 5rem);
        grid-column: 1;
        grid-row: 1;
    }

    .tdp-login-brand::before {
        width: 36rem;
        height: 36rem;
        top: -22rem;
        right: -18rem;
    }

    .tdp-login-brand::after {
        width: 24rem;
        height: 24rem;
        right: -13rem;
        bottom: -15rem;
        box-shadow: 0 0 0 5rem rgba(212, 175, 55, 0.035);
    }

    .tdp-login-crest {
        height: 76px;
    }

    .tdp-login-identity strong {
        font-size: 1.25rem;
    }

    .tdp-login-brand-copy {
        margin: auto 0;
    }

    .tdp-login-brand-copy .tdp-login-title {
        font-size: clamp(2.3rem, 3.5vw, 3.7rem);
    }

    .tdp-login-brand-copy > p:last-child {
        font-size: 1rem;
    }

    .tdp-login-since {
        display: block;
    }

    .login-main {
        min-height: 100vh;
        min-height: 100dvh;
        grid-column: 2;
        grid-row: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
