:root {
    --brand: #0d9488;
    --brand-deep: #1e3a8a;
    --accent: #f59e0b;
    --ink: #0b132b;
    --text: #1f2937;
    --muted: #64748b;
    --line: #d7e2ee;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.public-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(245, 158, 11, 0.2), transparent 35%),
        radial-gradient(circle at 88% 22%, rgba(13, 148, 136, 0.24), transparent 40%),
        linear-gradient(145deg, #0b1220 0%, #1e3a8a 52%, #0d9488 100%);
    position: relative;
    overflow-x: hidden;
    padding: 18px 14px;
}

body.public-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.35;
    pointer-events: none;
}

body.public-page::after {
    content: '';
    position: fixed;
    right: -140px;
    bottom: -160px;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
    filter: blur(16px);
    pointer-events: none;
}

.top-nav-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
}

.top-nav-link a {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0.4rem 0.82rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.top-nav-link a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

main.legal-wrapper,
main.auth-wrapper {
    position: relative;
    z-index: 2;
}

main.legal-wrapper {
    max-width: 980px;
    margin: 72px auto 22px;
}

.legal-hero {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 24px;
    box-shadow: 0 22px 48px rgba(11, 19, 43, 0.3);
    padding: 1.9rem 1.8rem;
    text-align: center;
    margin-bottom: 1rem;
}

.legal-hero .hero-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.28rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    box-shadow: 0 14px 30px rgba(30, 58, 138, 0.24);
    margin-bottom: 0.9rem;
}

.legal-hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    font-size: clamp(1.7rem, 3.3vw, 2.35rem);
    margin: 0;
}

.legal-hero p {
    margin: 0.55rem 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.legal-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 24px;
    box-shadow: 0 24px 55px rgba(11, 19, 43, 0.34);
    padding: 2rem 1.8rem;
}

.legal-card h2 {
    color: var(--brand-deep);
    font-size: 1.34rem;
    font-weight: 800;
    margin: 1.6rem 0 0.75rem;
}

.legal-card h2:first-child {
    margin-top: 0;
}

.legal-card h3 {
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 700;
    margin: 1.05rem 0 0.42rem;
}

.legal-card p,
.legal-card li {
    color: #334155;
    line-height: 1.7;
    margin-bottom: 0.82rem;
}

.legal-card ul {
    margin: 0 0 0.9rem 1.25rem;
    padding: 0;
}

.legal-actions {
    text-align: center;
    margin-top: 2rem;
}

.btn-brand-outline {
    border: 2px solid rgba(30, 58, 138, 0.24);
    color: var(--brand-deep);
    padding: 0.58rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-brand-outline:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    border-color: transparent;
}

.public-footer {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9rem;
    padding-bottom: 0.55rem;
}

main.auth-wrapper {
    width: 100%;
    max-width: 460px;
    margin: 64px auto 10px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 2.05rem 1.75rem;
    box-shadow: 0 24px 55px rgba(11, 19, 43, 0.34);
    border: 0;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.05rem;
}

.auth-brand i {
    font-size: 2.7rem;
    background: linear-gradient(135deg, var(--brand-deep), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.53rem;
    color: var(--ink);
    margin: 0.55rem 0 0.18rem;
}

.auth-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-card .form-label {
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.45rem;
    font-size: 0.94rem;
}

.auth-card .form-control {
    padding: 0.72rem 0.88rem;
    border-radius: 12px;
    border: 2px solid var(--line);
    font-size: 0.95rem;
    transition: all 0.22s ease;
    background: #fcfeff;
}

.auth-card .form-control:focus {
    border-color: rgba(30, 58, 138, 0.55);
    box-shadow: 0 0 0 0.22rem rgba(30, 58, 138, 0.14);
    background: #fff;
}

.btn-brand {
    width: 100%;
    padding: 0.82rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.98rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    border: none;
    color: #fff;
    transition: all 0.24s ease;
    box-shadow: 0 12px 24px rgba(30, 58, 138, 0.24);
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 28px rgba(30, 58, 138, 0.32);
    color: #fff;
}

.auth-note {
    background: #f6f9ff;
    border: 1px solid #d7e2ee;
    border-radius: 12px;
    padding: 0.75rem 0.86rem;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-note i {
    color: var(--brand);
}

.inline-divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.inline-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e2e8f0;
}

.inline-divider span {
    background: rgba(255, 255, 255, 0.94);
    padding: 0 1rem;
    position: relative;
    color: var(--muted);
    font-size: 0.9rem;
}

.muted-link {
    color: var(--brand-deep);
    text-decoration: none;
    font-weight: 700;
}

.muted-link:hover {
    text-decoration: underline;
}

.message-stack {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    margin: 62px auto 8px;
}

.message-stack .alert {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(11, 19, 43, 0.2);
}

@media (max-width: 768px) {
    main.legal-wrapper {
        margin-top: 66px;
    }

    .legal-hero,
    .legal-card {
        border-radius: 18px;
        padding: 1.35rem 1.1rem;
    }

    main.auth-wrapper,
    .message-stack {
        margin-top: 62px;
    }

    .auth-card {
        border-radius: 18px;
        padding: 1.45rem 1.1rem;
    }
}
