:root {
    --color-bg: #f4f8ff;
    --color-bg-alt: rgba(255, 255, 255, 0.75);
    --color-border: rgba(219, 230, 242, 0.5);
    --color-primary: #0d69c9;
    --color-secondary: #ffc400;
    --color-text: #0a2540;
    --color-text-muted: #5b7289;
    --color-white: #ffffff;
    --max-width: 1100px;
    --card-radius: 28px;
    --blur-strength: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
    z-index: -2;
}

.backdrop {
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, rgba(6, 26, 47, 0.75) 0%, rgba(6, 26, 47, 0.4) 35%, rgba(13, 105, 201, 0.35) 55%, rgba(244, 248, 255, 0.15) 100%);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.auth-shell {
    position: relative;
    width: min(100%, var(--max-width));
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem);
    display: grid;
    gap: clamp(1.5rem, 4vw, 2.75rem);
    align-items: center;
    min-height: 100vh;
}

.brand-badge {
    position: absolute;
    top: clamp(1.5rem, 4vw, 2.25rem);
    left: clamp(1.5rem, 5vw, 2.75rem);
    z-index: 2;
    backdrop-filter: blur(calc(var(--blur-strength) / 2));
    background: rgba(10, 37, 64, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    box-shadow: 0 16px 40px rgba(6, 26, 47, 0.28);
    transform: translateY(-10px);
    animation: badge-drop 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
    opacity: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--color-white);
    text-decoration: none;
}

.brand-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(13, 105, 201, 0.9), rgba(13, 57, 112, 0.9));
    display: grid;
    place-items: center;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 1.35rem;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15), 0 10px 30px rgba(13, 105, 201, 0.4);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.auth-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(1.25rem, 3vw, 2rem);
    border-radius: var(--card-radius);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.07));
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 28px 80px rgba(10, 37, 64, 0.45);
    padding: clamp(2rem, 4vw, 3rem);
    backdrop-filter: blur(var(--blur-strength));
    overflow: hidden;
    isolation: isolate;
    transform: translateY(40px);
    opacity: 0;
    animation: card-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

.card-hero {
    position: relative;
    border-radius: calc(var(--card-radius) - 12px);
    background: linear-gradient(160deg, rgba(13, 105, 201, 0.9), rgba(6, 26, 47, 0.85));
    color: var(--color-white);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: clamp(320px, 50vh, 460px);
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    transform-style: preserve-3d;
    transform: perspective(1200px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-pulse {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 196, 0, 0.35), rgba(13, 105, 201, 0) 60%);
    mix-blend-mode: screen;
    animation: pulse 6s ease-in-out infinite;
}

.card-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("/img/GreekPattern.png");
    background-size: 260px;
    opacity: 0.15;
    mix-blend-mode: soft-light;
    transform: translateY(0);
    animation: pattern-drift 14s linear infinite;
}

.card-hero::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 196, 0, 0.6) 0%, rgba(255, 196, 0, 0) 65%);
    filter: blur(0px);
    opacity: 0.75;
    animation: float 7s ease-in-out infinite;
}

.hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1rem;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.hero-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.promise-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.86);
}

.promise-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-form {
    align-self: center;
    display: grid;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(0.5rem, 1vw, 1rem) 0;
}

.form-message {
    min-height: 1.25rem;
    font-size: 0.9rem;
    color: var(--color-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-message.show {
    opacity: 1;
}

.input-group {
    display: grid;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(13, 105, 201, 0.25);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 3px rgba(13, 105, 201, 0.1);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.input-wrapper:focus-within {
    border-color: rgba(13, 105, 201, 0.65);
    box-shadow: 0 8px 24px rgba(13, 105, 201, 0.18);
    transform: translateY(-1px);
}

.input-icon {
    font-size: 1.1rem;
    opacity: 0.85;
}

.input-wrapper input {
    border: none;
    outline: none;
    flex: 1;
    background: transparent;
    font-size: 1rem;
    color: var(--color-text);
}

.toggle-password {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    opacity: 1;
}

.link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

.link.subtle {
    font-size: 0.85rem;
    font-weight: 500;
    justify-self: flex-end;
}

.btn {
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 999px;
    padding: 0.95rem 1.15rem;
}

.btn-primary {
    background: linear-gradient(120deg, rgba(13, 105, 201, 0.95), rgba(13, 57, 112, 0.95));
    color: var(--color-white);
    box-shadow: 0 18px 30px rgba(13, 105, 201, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 36px rgba(13, 105, 201, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-form.is-submitting .btn-primary {
    pointer-events: none;
    opacity: 0.7;
    box-shadow: 0 10px 20px rgba(13, 105, 201, 0.25);
}

.divider {
    position: relative;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: rgba(10, 37, 64, 0.18);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.quick-actions {
    display: grid;
    gap: 0.75rem;
}

.quick-btn {
    border: 1px solid rgba(13, 105, 201, 0.25);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    padding: 0.9rem 1.15rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    color: var(--color-text);
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(6, 26, 47, 0.2);
    border-color: rgba(13, 105, 201, 0.5);
}

.quick-btn span {
    font-size: 1.15rem;
}

.onboarding-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
}

.onboarding-note .link {
    font-weight: 700;
}

/* Animations */
@keyframes badge-drop {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.92);
    }

    60% {
        transform: translateY(4px) scale(1.02);
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes card-rise {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

    70% {
        transform: translateY(-6px) scale(1.01);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(18px) translateX(-8px);
    }
}

@keyframes pattern-drift {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-60px);
    }
}

[data-animate="stagger"] {
    opacity: 0;
    transform: translateY(16px);
    animation: stagger-up 0.6s ease forwards;
}

[data-animate="stagger"]:nth-of-type(1) {
    animation-delay: 0.6s;
}

[data-animate="stagger"]:nth-of-type(2) {
    animation-delay: 0.75s;
}

[data-animate="stagger"]:nth-of-type(3) {
    animation-delay: 0.9s;
}

@keyframes stagger-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 960px) {
    body {
        overflow: auto;
    }

    .auth-card {
        grid-template-columns: 1fr;
        padding: clamp(1.75rem, 5vw, 2.5rem);
    }

    .card-hero {
        order: -1;
        min-height: auto;
    }

    .brand-badge {
        position: static;
        justify-self: center;
        transform: none;
        opacity: 1;
        animation: none;
        margin-bottom: 1.5rem;
    }

    .auth-shell {
        padding-top: clamp(4rem, 10vw, 6rem);
        padding-bottom: clamp(4rem, 10vw, 6rem);
    }
}

@media (max-width: 600px) {
    .auth-shell {
        padding-inline: clamp(1rem, 6vw, 1.5rem);
    }

    .auth-card {
        border-radius: 24px;
        padding: clamp(1.5rem, 6vw, 2rem);
        box-shadow: 0 20px 60px rgba(6, 26, 47, 0.35);
    }

    .card-hero {
        border-radius: 20px;
    }

    .promise-list {
        font-size: 0.9rem;
    }

    .input-wrapper {
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}