/* ============================================
   FALZZTOPUP — Premium Blue Glassmorphism Login
   ============================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy-900: #050b1a;
    --navy-800: #071229;
    --navy-700: #0a1a3a;
    --navy-600: #0e2248;
    --blue-electric: #2f7bff;
    --blue-bright: #4d9aff;
    --blue-glow: #1a6dff;
    --blue-soft: #7db8ff;
    --blue-border: rgba(77, 154, 255, 0.22);
    --blue-border-strong: rgba(77, 154, 255, 0.4);
    --glass-bg: rgba(10, 26, 58, 0.55);
    --glass-bg-strong: rgba(12, 32, 70, 0.72);
    --glass-highlight: rgba(120, 180, 255, 0.06);
    --text-primary: #eaf3ff;
    --text-secondary: #9db6d8;
    --text-muted: #6b85a8;
    --text-placeholder: #5a7296;
    --error: #ff5c7a;
    --error-bg: rgba(255, 92, 122, 0.1);
    --success: #3ee08f;
    --radius-card: 28px;
    --radius-input: 14px;
    --radius-btn: 14px;
    --shadow-card: 0 30px 80px -20px rgba(0, 8, 30, 0.85),
                   0 0 0 1px rgba(77, 154, 255, 0.08),
                   inset 0 1px 0 rgba(150, 200, 255, 0.08);
    --shadow-glow: 0 0 40px rgba(26, 109, 255, 0.25);
    --shadow-btn: 0 8px 24px -4px rgba(26, 109, 255, 0.55);
    --shadow-btn-hover: 0 12px 32px -4px rgba(26, 109, 255, 0.7);
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--navy-900);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* ---------- Ambient Background ---------- */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 120% 80% at 50% -10%, rgba(26, 109, 255, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 90% 70% at 85% 100%, rgba(15, 60, 160, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 10% 90%, rgba(10, 40, 120, 0.3) 0%, transparent 55%),
        linear-gradient(160deg, #050b1a 0%, #071229 35%, #081a3c 70%, #050b1a 100%);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
    pointer-events: none;
}

.glow-1 {
    width: 520px;
    height: 520px;
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(47, 123, 255, 0.5) 0%, rgba(26, 109, 255, 0.15) 45%, transparent 70%);
    animation: drift-1 16s ease-in-out infinite alternate;
}

.glow-2 {
    width: 420px;
    height: 420px;
    bottom: -160px;
    right: -100px;
    background: radial-gradient(circle, rgba(30, 90, 220, 0.45) 0%, transparent 65%);
    animation: drift-2 20s ease-in-out infinite alternate;
}

.glow-3 {
    width: 380px;
    height: 380px;
    bottom: 10%;
    left: -140px;
    background: radial-gradient(circle, rgba(60, 140, 255, 0.3) 0%, transparent 65%);
    animation: drift-3 18s ease-in-out infinite alternate;
}

@keyframes drift-1 {
    0% { transform: translate(-50%, 0) scale(1); }
    100% { transform: translate(-46%, 40px) scale(1.1); }
}

@keyframes drift-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, -40px) scale(1.12); }
}

@keyframes drift-3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.08); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(77, 154, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 154, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 0%, transparent 80%);
}

/* ---------- Login Page Layout ---------- */
.login-page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    animation: page-fade-in 0.9s var(--ease-out) both;
}

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Login Card ---------- */
.login-card {
    width: 100%;
    background: linear-gradient(160deg, var(--glass-bg-strong) 0%, var(--glass-bg) 100%);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    padding: 40px 34px 26px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120, 180, 255, 0.6), transparent);
}

.login-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 70%;
    height: 100%;
    background: radial-gradient(circle, var(--glass-highlight) 0%, transparent 70%);
    pointer-events: none;
}

/* ---------- Brand ---------- */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-logo-wrap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(47, 123, 255, 0.1);
    border: 1px solid var(--blue-border);
    box-shadow: 0 0 20px rgba(26, 109, 255, 0.2), inset 0 1px 0 rgba(150, 200, 255, 0.1);
    flex-shrink: 0;
    transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
}

.brand:hover .brand-logo-wrap {
    transform: scale(1.05);
    box-shadow: 0 0 28px rgba(26, 109, 255, 0.35), inset 0 1px 0 rgba(150, 200, 255, 0.15);
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--text-primary);
    background: linear-gradient(180deg, #ffffff 0%, #a8cdff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(47, 123, 255, 0.25);
}

/* ---------- Title Section ---------- */
.title-section {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ---------- Form ---------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    padding-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    width: 19px;
    height: 19px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color 0.3s var(--ease-smooth);
    z-index: 2;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

.input-field {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 46px;
    background: rgba(5, 15, 35, 0.5);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: border-color 0.3s var(--ease-smooth),
                box-shadow 0.3s var(--ease-smooth),
                background 0.3s var(--ease-smooth);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.input-field::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
}

.input-field:hover {
    border-color: rgba(77, 154, 255, 0.35);
    background: rgba(8, 20, 45, 0.6);
}

.input-field:focus {
    border-color: var(--blue-bright);
    background: rgba(8, 22, 52, 0.75);
    box-shadow: 0 0 0 3.5px rgba(47, 123, 255, 0.16),
                0 0 24px rgba(26, 109, 255, 0.18);
}

.input-wrapper:focus-within .input-icon {
    color: var(--blue-bright);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.25s var(--ease-smooth), background 0.25s var(--ease-smooth);
    z-index: 3;
    -webkit-tap-highlight-color: transparent;
}

.toggle-password:hover {
    color: var(--blue-bright);
    background: rgba(47, 123, 255, 0.1);
}

.toggle-password:active {
    background: rgba(47, 123, 255, 0.18);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.eye-closed {
    display: none;
}

.toggle-password.is-visible .eye-open {
    display: none;
}

.toggle-password.is-visible .eye-closed {
    display: block;
}

/* Error state */
.field-group.has-error .input-field {
    border-color: var(--error);
    background: var(--error-bg);
}

.field-group.has-error .input-icon {
    color: var(--error);
}

.field-group.has-error .input-field:focus {
    box-shadow: 0 0 0 3.5px rgba(255, 92, 122, 0.15),
                0 0 24px rgba(255, 92, 122, 0.12);
}

.field-error {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--error);
    padding-left: 2px;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.3s var(--ease-smooth),
                opacity 0.3s var(--ease-smooth),
                transform 0.3s var(--ease-smooth);
}

.field-group.has-error .field-error {
    min-height: 18px;
    max-height: 40px;
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Options Row ---------- */
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-box {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1.5px solid var(--blue-border-strong);
    background: rgba(5, 15, 35, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease-smooth);
}

.checkbox-box svg {
    width: 13px;
    height: 13px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}

.checkbox-input:checked + .checkbox-box {
    background: linear-gradient(135deg, var(--blue-electric), #1a5fd6);
    border-color: var(--blue-bright);
    box-shadow: 0 0 14px rgba(47, 123, 255, 0.4);
}

.checkbox-input:checked + .checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-input:focus-visible + .checkbox-box {
    box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.25);
}

.checkbox-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.link-subtle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue-soft);
    text-decoration: none;
    transition: color 0.25s var(--ease-smooth), text-shadow 0.25s var(--ease-smooth);
    position: relative;
}

.link-subtle:hover {
    color: var(--blue-bright);
    text-shadow: 0 0 16px rgba(77, 154, 255, 0.5);
}

.link-subtle::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease-smooth);
    opacity: 0.5;
}

.link-subtle:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ---------- Primary Button ---------- */
.btn-primary {
    width: 100%;
    height: 54px;
    margin-top: 4px;
    border: none;
    border-radius: var(--radius-btn);
    background: linear-gradient(135deg, #2f7bff 0%, #1a5fd6 55%, #1450c4 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-btn), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.25s var(--ease-smooth),
                box-shadow 0.25s var(--ease-smooth),
                filter 0.25s var(--ease-smooth);
    -webkit-tap-highlight-color: transparent;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    filter: brightness(1.08);
}

.btn-primary:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(0.96);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--shadow-btn), 0 0 0 3.5px rgba(47, 123, 255, 0.35);
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.btn-text {
    display: inline-block;
    transition: opacity 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}

.btn-primary.is-loading .btn-text {
    opacity: 0;
    transform: translateY(6px);
}

.btn-primary.is-loading .btn-loader {
    opacity: 1;
    transform: scale(1);
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: scale(1) rotate(360deg); }
}

/* ---------- Form Status ---------- */
.form-status {
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    color: var(--error);
    min-height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-smooth),
                opacity 0.3s var(--ease-smooth),
                margin 0.3s var(--ease-smooth);
}

.form-status.is-visible {
    min-height: 18px;
    max-height: 60px;
    opacity: 1;
    margin-top: 2px;
}

.form-status.is-success {
    color: var(--success);
}

/* ---------- Divider ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 20px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue-border-strong), transparent);
}

.divider-text {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

/* ---------- Google Button ---------- */
.btn-google {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-btn);
    color: #1f2937;
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.25s var(--ease-smooth),
                box-shadow 0.25s var(--ease-smooth),
                background 0.25s var(--ease-smooth);
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.3);
}

.btn-google:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(77, 154, 255, 0.3);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.3);
}

.btn-google:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(47, 123, 255, 0.35);
}

.google-icon {
    flex-shrink: 0;
    display: block;
}

.btn-google-text {
    line-height: 1;
}

/* ---------- Register ---------- */
.register-text {
    text-align: center;
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin-top: 24px;
}

.link-accent {
    color: var(--blue-bright);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.25s var(--ease-smooth), text-shadow 0.25s var(--ease-smooth);
}

.link-accent:hover {
    color: #7db8ff;
    text-shadow: 0 0 16px rgba(77, 154, 255, 0.6);
}

/* ---------- Card Footer ---------- */
.card-footer {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(77, 154, 255, 0.08);
}

.card-footer span {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ---------- Page Footer ---------- */
.page-footer {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.7;
}

/* ---------- Shake Animation ---------- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.login-card.shake {
    animation: shake 0.45s var(--ease-smooth);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .login-page {
        padding: 20px 14px;
        gap: 16px;
    }

    .login-card {
        padding: 34px 22px 22px;
        border-radius: 24px;
    }

    .title { font-size: 1.32rem; }
    .subtitle { font-size: 0.85rem; }

    .brand-logo-wrap {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .brand-logo {
        width: 25px;
        height: 25px;
    }

    .brand-name { font-size: 1.08rem; }

    .input-field {
        height: 50px;
        font-size: 0.9rem;
    }

    .btn-primary {
        height: 52px;
        font-size: 0.94rem;
    }

    .btn-google {
        height: 50px;
        font-size: 0.89rem;
        gap: 9px;
    }

    .divider { margin: 20px 0 18px; }

    .options-row {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .login-card { padding: 28px 18px 20px; }

    .brand-name {
        font-size: 0.98rem;
        letter-spacing: 0.1em;
    }

    .title { font-size: 1.2rem; }
    .btn-google-text { font-size: 0.84rem; }

    .checkbox-label,
    .link-subtle {
        font-size: 0.8rem;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .glow { animation: none !important; }
}

/* ---------- Light mode (fallback) ---------- */
@media (prefers-color-scheme: light) {
    /* Keep dark identity — intentionally no change */
}
