/* ============================================================
   Atlas Auth — Login & Register
   Atmospheric backdrop + split card (brand | form)
   ============================================================ */

.atlas-auth-body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--color-navy-900);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(0, 200, 232, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 100%, rgba(30, 69, 204, 0.22) 0%, transparent 50%),
        var(--gradient-navy);
    color: var(--color-text);
    overflow-x: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Atmospheric backdrop ---------- */

.atlas-auth-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.atlas-auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

.atlas-auth-blob--a {
    width: 480px;
    height: 480px;
    top: -160px;
    left: -120px;
    background: radial-gradient(circle, rgba(0, 200, 232, 0.45) 0%, transparent 70%);
    animation: atlas-auth-drift-a 22s ease-in-out infinite alternate;
}

.atlas-auth-blob--b {
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -180px;
    background: radial-gradient(circle, rgba(30, 69, 204, 0.55) 0%, transparent 70%);
    animation: atlas-auth-drift-b 28s ease-in-out infinite alternate;
}

.atlas-auth-blob--c {
    width: 280px;
    height: 280px;
    top: 40%;
    right: 8%;
    background: radial-gradient(circle, rgba(0, 200, 232, 0.30) 0%, transparent 70%);
    animation: atlas-auth-drift-c 18s ease-in-out infinite alternate;
}

@keyframes atlas-auth-drift-a {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(60px, 80px); }
}

@keyframes atlas-auth-drift-b {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-80px, -60px); }
}

@keyframes atlas-auth-drift-c {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-40px, 40px); }
}

@media (prefers-reduced-motion: reduce) {
    .atlas-auth-blob { animation: none; }
}

/* ---------- Shell ---------- */

.atlas-auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    padding: var(--space-5);
}

/* ---------- Card ---------- */

.atlas-auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.50);
    overflow: hidden;
    min-height: 580px;
}

@media (max-width: 768px) {
    .atlas-auth-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }
}

/* ---------- Brand side ---------- */

.atlas-auth-brand {
    position: relative;
    background-color: var(--color-navy-800);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(0, 200, 232, 0.22) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(30, 69, 204, 0.32) 0%, transparent 50%),
        var(--gradient-navy);
    color: white;
    padding: var(--space-7) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.atlas-auth-brand__wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 80' preserveAspectRatio='none'%3E%3Cpath d='M0 40 Q 75 5 150 40 T 300 40 T 450 40 T 600 40' stroke='%2300C8E8' stroke-width='2' fill='none' opacity='0.45'/%3E%3Cpath d='M0 55 Q 75 25 150 55 T 300 55 T 450 55 T 600 55' stroke='%231E45CC' stroke-width='2' fill='none' opacity='0.40'/%3E%3Cpath d='M0 70 Q 75 45 150 70 T 300 70 T 450 70 T 600 70' stroke='%2300C8E8' stroke-width='1.5' fill='none' opacity='0.25'/%3E%3C/svg%3E");
    pointer-events: none;
}

.atlas-auth-brand__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 320px;
}

.atlas-auth-brand__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
}

.atlas-auth-brand__logo img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter:
        drop-shadow(0 0 6px rgba(6, 182, 212, 0.55))
        drop-shadow(0 0 18px rgba(6, 182, 212, 0.35))
        drop-shadow(0 8px 24px rgba(0, 200, 232, 0.45));
}

.atlas-auth-brand__logo-fallback {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-extrabold);
    font-size: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 200, 232, 0.45);
}

.atlas-auth-brand__title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-extrabold);
    letter-spacing: -0.03em;
    margin: 0 0 var(--space-3);
    color: white;
    line-height: 1;
}

.atlas-auth-brand__tagline {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

@media (max-width: 768px) {
    .atlas-auth-brand {
        padding: var(--space-5);
        min-height: 220px;
    }

    .atlas-auth-brand__logo img,
    .atlas-auth-brand__logo-fallback {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
    }

    .atlas-auth-brand__title { font-size: 1.75rem; }
    .atlas-auth-brand__tagline { font-size: 0.85rem; }
}

/* ---------- Form side ---------- */

.atlas-auth-form {
    padding: var(--space-7) var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .atlas-auth-form { padding: var(--space-6) var(--space-5); }
}

.atlas-auth-form__header { margin-bottom: var(--space-6); }

.atlas-auth-form__header h2 {
    font-size: 1.65rem;
    font-weight: var(--font-weight-extrabold);
    margin: 0 0 var(--space-2);
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.atlas-auth-form__header p {
    color: var(--color-text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.atlas-auth-form__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.atlas-auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-1);
}

/* ---------- Field ---------- */

.atlas-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.atlas-field__label {
    font-size: 0.85rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0;
}

.atlas-field__input-wrap { position: relative; }

.atlas-field__input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.atlas-field__input::placeholder { color: rgba(15, 23, 42, 0.35); }

.atlas-field__input:hover { border-color: rgba(30, 69, 204, 0.30); }

.atlas-field__input:focus {
    outline: none;
    border-color: var(--color-blue-500);
    box-shadow: 0 0 0 4px rgba(44, 91, 255, 0.12);
}

.atlas-field__icon {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 180ms ease;
}

.atlas-field__input:focus ~ .atlas-field__icon {
    color: var(--color-blue-600);
}

.atlas-field__error {
    color: var(--color-danger);
    font-size: 0.82rem;
    min-height: 1em;
}

/* ---------- Custom checkbox ---------- */

.atlas-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.atlas-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--color-border);
    border-radius: 5px;
    background: var(--color-surface);
    cursor: pointer;
    position: relative;
    transition: background 150ms ease, border-color 150ms ease;
    flex-shrink: 0;
}

.atlas-checkbox input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: transparent;
}

.atlas-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.485 1.929 5.879 9.535 2.515 6.172 1.1 7.586l4.779 4.779L14.9 3.343z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.atlas-checkbox:hover input[type="checkbox"]:not(:checked) {
    border-color: var(--color-blue-500);
}

/* ---------- Submit button ---------- */

.atlas-auth-form__submit {
    margin-top: var(--space-3);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.85rem 1.5rem;
    font-family: var(--font-family-base);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(30, 69, 204, 0.30);
    transition: transform 180ms ease, box-shadow 180ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.atlas-auth-form__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(30, 69, 204, 0.40);
}

.atlas-auth-form__submit:active { transform: translateY(0); }

.atlas-auth-form__submit i { transition: transform 180ms ease; }
.atlas-auth-form__submit:hover i { transform: translateX(3px); }

/* ---------- Divider ---------- */

.atlas-auth-form__divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0 var(--space-4);
    color: var(--color-text-muted);
}

.atlas-auth-form__divider::before,
.atlas-auth-form__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.atlas-auth-form__divider span {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    font-weight: var(--font-weight-semibold);
}

/* ---------- Footnote ---------- */

.atlas-auth-form__footnote {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.atlas-auth-form__footnote a {
    color: var(--color-blue-600);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: color 150ms ease;
}

.atlas-auth-form__footnote a:hover {
    color: var(--color-blue-500);
    text-decoration: underline;
}

/* ---------- Validation summary alert override ---------- */

.atlas-auth-form .alert-danger {
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.20);
    background: rgba(239, 68, 68, 0.06);
    color: #991B1B;
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    border-left-width: 4px;
    border-left-color: var(--color-danger);
    margin-bottom: 0;
}

.atlas-auth-form .alert-danger:empty { display: none; }

/* ---------- Two-column form grid (Register) ---------- */

.atlas-auth-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

@media (max-width: 540px) {
    .atlas-auth-form__grid { grid-template-columns: 1fr; }
}
