:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, .86);
    --border-glass: rgba(15, 23, 42, .10);
    --accent: #053fa0;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, .3);
    --radius-card: 20px;
    --radius-control: 12px;
    --shadow-card: 0 18px 45px rgba(15, 23, 42, .08);
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #dc3545;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255, 255, 255, .06);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .06);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), #a855f7);
    border-radius: 999px;
}

body {
    min-height: 100vh;
    color: var(--text-primary);
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, .12), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(14, 165, 233, .10), transparent 32%),
        radial-gradient(circle at 55% 90%, rgba(34, 197, 94, .08), transparent 30%),
        var(--bg-primary);
    background-size: 140% 140%;
    animation: app-bg-drift 18s ease-in-out infinite alternate;
}

@keyframes app-bg-drift {
    from { background-position: 0% 0%; }
    to { background-position: 100% 70%; }
}

h1, h2, h3, .app-heading {
    font-family: "Syne", system-ui, sans-serif;
    letter-spacing: 0;
}

h1, .h1 {
    font-size: clamp(1.8rem, 2.6vw, 2.35rem);
}

h2, .h2 {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.display-4 {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    line-height: 1.05;
}

.display-5 {
    font-size: clamp(1.75rem, 2.8vw, 2.35rem);
    line-height: 1.08;
}

.app-auth-page {
    min-height: 100vh;
}

.app-auth-split {
    min-height: 100vh;
}

.app-auth-close {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 20;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
    backdrop-filter: blur(18px);
    transition: color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.app-auth-close:hover,
.app-auth-close:focus {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}

.app-art-panel {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(14, 165, 233, .10)),
        rgba(255, 255, 255, .72);
    border-color: var(--border-glass) !important;
}

.app-gradient-mesh {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, .24), transparent 22%),
        radial-gradient(circle at 72% 24%, rgba(14, 165, 233, .18), transparent 22%),
        radial-gradient(circle at 45% 76%, rgba(34, 197, 94, .14), transparent 24%);
    filter: blur(8px);
    animation: app-mesh 14s ease-in-out infinite alternate;
}

@keyframes app-mesh {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(9deg) scale(1.08); }
}

.app-shape {
    position: absolute;
    width: 86px;
    height: 86px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .46);
    backdrop-filter: blur(18px);
    animation: app-float 7s ease-in-out infinite;
}

.app-shape-one {
    top: 16%;
    right: 16%;
    border-radius: 24px;
}

.app-shape-two {
    bottom: 18%;
    left: 12%;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    animation-delay: -2s;
}

.app-shape-three {
    right: 18%;
    bottom: 28%;
    width: 52px;
    height: 52px;
    transform: rotate(45deg);
    animation-delay: -4s;
}

.app-hero-stack {
    width: min(100%, 540px);
    margin-inline: auto;
}

.app-hero-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 24px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, .14);
    background: #e2e8f0;
}

.app-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, .16));
    pointer-events: none;
}

@keyframes app-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

.app-glass-card {
    background: var(--bg-glass);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(24px);
}

.app-form-control,
.form-control {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .9);
    border-color: #e5e7eb;
    border-radius: var(--radius-control);
    min-height: 44px;
    font-size: .92rem;
}

.app-form-control:focus,
.form-control:focus {
    color: var(--text-primary);
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 .18rem rgba(99, 91, 255, .16);
}

.form-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.input-group-text {
    color: var(--accent);
    background: rgba(248, 250, 252, .96);
    border-color: #e5e7eb;
    border-radius: var(--radius-control);
    min-height: 44px;
}

.app-password-toggle {
    width: 44px;
    color: var(--text-muted);
    border-color: #e5e7eb;
    background: rgba(248, 250, 252, .96);
}

.app-password-toggle:hover,
.app-password-toggle:focus {
    color: var(--accent);
    background: #fff;
}

.invalid-feedback,
.app-error {
    color: var(--danger);
    font-size: .8rem;
}

.invalid-feedback::before,
.app-error::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border-radius: 999px;
    color: #fff;
    background: var(--danger);
    font-size: .7rem;
    font-weight: 700;
}

.app-btn-gradient {
    position: relative;
    overflow: hidden;
    color: #fff;
    border: 0;
    min-height: 44px;
    border-radius: var(--radius-control);
    background: linear-gradient(135deg, var(--accent), #8b5cf6);;
    box-shadow: 0 12px 26px rgba(99, 91, 255, .24);
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn {
    min-height: 42px;
    font-size: .9rem;
    font-weight: 600;
    white-space: normal;
}

.app-btn-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    translate: -120% 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transition: translate .7s ease;
}

.app-btn-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(99, 91, 255, .3);
}

.app-btn-gradient:hover::after {
    translate: 120% 0;
}

.app-ghost-link {
    color: var(--text-muted);
    text-decoration: none;
}

.app-ghost-link:hover {
    color: var(--text-primary);
}

.app-toggle {
    width: 35px !important;
    height: 22px;
    border-color: var(--border-glass);
    background-color: rgba(15, 23, 42, .12);
    cursor: pointer;
}

.app-toggle:checked {
    border-color: var(--accent);
    background-color: var(--accent);
}

.app-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-family: "JetBrains Mono", monospace;
    font-size: .68rem;
    text-transform: uppercase;
}

.app-step-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--border-glass);
}

.app-step.is-active {
    color: var(--text-primary);
}

.app-step.is-active .app-step-dot {
    background: var(--accent);
    box-shadow: 0 0 18px var(--accent-glow);
}

.app-strength {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--danger) 0 33%, var(--warning) 33% 66%, var(--success) 66% 100%);
    opacity: .85;
}

.app-check {
    color: var(--text-muted);
    opacity: .75;
    transition: color .2s ease, opacity .2s ease;
}

.app-check.is-valid {
    color: var(--success);
    opacity: 1;
}

.app-mail-svg {
    width: 72px;
    height: 72px;
    color: var(--accent);
}

.app-feature-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    color: var(--accent);
    background: rgba(99, 102, 241, .12);
    border-radius: 999px;
    font-size: 1.55rem;
}

.app-feature-icon.is-lg {
    width: 68px;
    height: 68px;
    font-size: 1.9rem;
}

.app-envelope-lid {
    transform-origin: 50% 42%;
    animation: app-envelope 2.6s ease-in-out infinite;
}

@keyframes app-envelope {
    0%, 100% { transform: rotateX(0deg); }
    50% { transform: rotateX(32deg); }
}

.text-secondary,
.text-muted {
    color: var(--text-muted) !important;
}

.alert {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .78);
    border-color: var(--border-glass);
    border-radius: 14px;
}

.app-auth-success-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #14532d;
    background: rgba(236, 253, 245, .88);
    border-color: rgba(34, 197, 94, .28);
    box-shadow: 0 12px 28px rgba(34, 197, 94, .08);
}

.app-auth-success-alert i {
    margin-top: 2px;
    color: var(--success);
}

@media (max-width: 991.98px) {
    .app-auth-split {
        min-height: 100svh;
    }

    .app-auth-page {
        min-height: 100svh;
    }

    .app-art-panel {
        min-height: auto;
        padding-block: 1.25rem !important;
    }

    .app-hero-stack {
        max-width: 620px;
    }

    .app-hero-image {
        aspect-ratio: 21 / 9;
        max-height: 220px;
    }
}

@media (max-width: 767.98px) {
    .app-auth-page,
    .app-auth-split {
        min-height: 100svh;
    }

    .app-auth-split > [class*="col-"] {
        min-height: 100svh;
    }

    h1, .h1 {
        font-size: clamp(1.55rem, 7vw, 2rem);
    }

    .display-4,
    .display-5 {
        font-size: clamp(1.65rem, 8vw, 2.15rem);
    }

    .app-art-panel {
        min-height: auto;
    }

    .app-shape {
        opacity: .35;
        scale: .76;
    }

    .app-glass-card {
        border-radius: 18px;
    }

    .app-feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .app-feature-icon.is-lg {
        width: 56px;
        height: 56px;
        font-size: 1.55rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 13.5px;
    }

    .app-auth-page {
        padding-block: 1rem !important;
    }

    .app-auth-split > [class*="col-"] {
        padding-inline: 1rem !important;
    }

    .app-hero-image {
        aspect-ratio: 16 / 8;
        max-height: 160px;
        border-radius: 18px;
    }

    .form-control,
    .input-group-text,
    .btn {
        min-height: 40px;
    }

    .app-toggle {
        width: 48px;
        height: 20px;
    }
}
