﻿*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --accent: #38BDF8;
    --accent-b: #0EA5E9;
    --accent-deep: #0369A1;
    --glass-bg: rgba(8, 20, 40, 0.45);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shine: rgba(255, 255, 255, 0.06);
    --text-white: rgba(255, 255, 255, 0.92);
    --text-dim: rgba(255, 255, 255, 0.45);
    --text-faint: rgba(255, 255, 255, 0.22);
    --input-bg: rgba(255, 255, 255, 0.07);
    --input-border: rgba(255, 255, 255, 0.14);
    --error: #F87171;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #09264e;
}

/* ═══ SCENE ═══ */
.perspective {
    position: relative;
    z-index: 2;
    perspective: 1400px;
    perspective-origin: 50% 40%;
}

.scene {
    width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: sceneIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-style: preserve-3d;
}

@keyframes sceneIn {
    from {
        opacity: 0;
        transform: translateY(60px) rotateX(14deg) scale(0.88);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
    }
}

/* ═══ AVATAR ═══ */
.avatar-outer {
    position: relative;
    z-index: 3;
    margin-bottom: -82px;
    transform: translateZ(40px);
    will-change: transform;
}

.avatar-circle {
    width: 185px;
    height: 186px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .avatar-circle .avatar-img {
        width: 185px;
        height: 186px;
        object-fit: cover;
    }

/* ═══ CARD ═══ */
.card-3d {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

.card {
    width: 100%;
    background: rgba(8, 18, 38, 0.42);
    backdrop-filter: blur(36px) saturate(1.9) brightness(1.1);
    -webkit-backdrop-filter: blur(36px) saturate(1.9) brightness(1.1);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    padding: 88px 36px 34px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 50px 100px rgba(0, 0, 0, 0.65), 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.13), inset 0 -1px 0 rgba(0, 0, 0, 0.25), inset 1px 0 0 rgba(255, 255, 255, 0.06), inset -1px 0 0 rgba(0, 0, 0, 0.15);
}

    /* Top glow line */
    .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.4) 20%, rgba(186, 230, 255, 0.95) 50%, rgba(56, 189, 248, 0.4) 80%, transparent 100%);
    }

    /* Inner sheen */
    .card::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 38%), radial-gradient(ellipse 80% 45% at 50% 0%, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
        pointer-events: none;
        border-radius: inherit;
    }

.card-sheen {
    position: absolute;
    top: 0;
    left: 0;
    width: 52%;
    height: 48%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 60%);
    border-radius: 26px 0 0 0;
    pointer-events: none;
}

.card-specular {
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

/* ─── HEADER ─── */
.card-header {
    text-align: center;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 0.6s 0.28s ease forwards;
}

.card-subtitle {
    font-size: 12.8px;
    font-weight: 300;
    color: var(--text-white);
    margin-top: 7px;
    letter-spacing: 0.02em;
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 0.5s 0.34s ease forwards;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

.divider-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    box-shadow: 0 0 8px var(--accent);
}

/* ─── FIELDS ─── */
.fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.field {
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

    .field:nth-child(1) {
        animation-delay: 0.40s;
    }

    .field:nth-child(2) {
        animation-delay: 0.46s;
    }

.field-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 7px;
    padding-left: 3px;
}

.field-wrap {
    position: relative;
}

.field-input {
    width: 100%;
    height: 50px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    padding: 0 46px 0 44px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-white);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

    .field-input::placeholder {
        color: rgba(255, 255, 255, 0.18);
        font-weight: 300;
    }

    .field-input:hover {
        border-color: rgba(56, 189, 248, 0.3);
        background: rgba(255, 255, 255, 0.08);
    }

    .field-input:focus {
        border-color: rgba(56, 189, 248, 0.55);
        background: rgba(56, 189, 248, 0.07);
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12), inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 18px rgba(56, 189, 248, 0.07);
    }

.field.has-error .field-input {
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.field-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    transition: color 0.25s;
    width: 25px;
    height: 25px;
}

.toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    transition: color 0.2s;
    border-radius: 7px;
}

    .toggle-btn:hover {
        color: var(--accent);
    }

.err-msg {
    display: none;
    font-size: 11px;
    font-weight: 500;
    color: var(--error);
    margin-top: 5px;
    padding-left: 3px;
}

.field.has-error .err-msg {
    display: block;
}

/* ─── FORGOT ─── */
.forgot-row {
    text-align: right;
    margin-top: 6px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 0.5s 0.52s ease forwards;
}

.forgot {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.2s;
}

    .forgot:hover {
        opacity: 1;
    }

/* ─── BUTTON ─── */
.btn-wrap {
    margin-top: 22px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 0.5s 0.58s ease forwards;
}

.btn {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent-b) 50%, var(--accent) 100%);
    border: none;
    border-radius: 13px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.18s, box-shadow 0.2s, filter 0.15s;
    box-shadow: 0 8px 36px rgba(14, 165, 233, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

    .btn::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(160deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
        border-radius: inherit;
        pointer-events: none;
    }

    .btn::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
        transform: skewX(-20deg);
        transition: left 0.6s ease;
    }

    .btn:hover::after {
        left: 145%;
    }

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 18px 52px rgba(14, 165, 233, 0.6), 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
        filter: brightness(1.06);
    }

    .btn:active {
        transform: translateY(-1px);
    }

    .btn:disabled {
        opacity: 0.44;
        cursor: not-allowed;
        transform: none !important;
    }

    .btn .arrow {
        transition: transform 0.2s;
    }

    .btn:hover:not(:disabled) .arrow {
        transform: translateX(5px);
    }

    .btn.loading .btn-label {
        opacity: 0;
    }

    .btn.loading .spin {
        display: flex;
    }

.spin {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: rot 0.65s linear infinite;
}

@keyframes rot {
    to {
        transform: rotate(360deg);
    }
}

/* ─── BRAND ─── */
.brand-badge {
    text-align: center;
    margin-top: 18px;
    opacity: 0;
    animation: fadeUp 0.5s 0.78s ease forwards;
}

.brand-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.17);
    letter-spacing: 0.12em;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(56, 189, 248, 0.07) inset !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.92) !important;
    caret-color: rgba(255, 255, 255, 0.92);
    transition: background-color 9999s ease-in-out 0s;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(13px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 460px) {
    .scene {
        width: calc(100vw - 32px);
    }

    .card {
        padding: 84px 22px 28px;
    }
}

.card-subtitle.error {
    color: #F87171 !important;
    font-weight: 500;
    margin-top: 8px;
    font-size: 13.5px;
}
