/* =========================================================
   CTW OFFICIAL — MEMBER LOGIN 3D GLASS MODE
   ========================================================= */

:root {
    --glass-bg: rgba(14, 21, 42, 0.68);
    --glass-bg-hover: rgba(22, 33, 62, 0.78);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-glow: rgba(99, 102, 241, 0.45);
    --glass-highlight: rgba(255, 255, 255, 0.22);
    --accent-primary: #6366f1;
    --accent-secondary: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --txt-main: #f8fafc;
    --txt-muted: #94a3b8;
    --txt-subtle: #64748b;
}

[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-hover: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(15, 23, 42, 0.12);
    --glass-border-glow: rgba(99, 102, 241, 0.35);
    --txt-main: #0f172a;
    --txt-muted: #475569;
    --txt-subtle: #64748b;
}

/* Background Scene with Ambient Glow */
.glass-scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.38;
    pointer-events: none;
    animation: floatAurora 20s ease-in-out infinite alternate;
}

.aurora-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(59, 130, 246, 0.2) 60%, transparent 80%);
    top: -12%;
    left: 8%;
    animation-duration: 22s;
}

.aurora-2 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.5) 0%, rgba(217, 70, 239, 0.2) 60%, transparent 80%);
    bottom: -15%;
    right: 5%;
    animation-duration: 26s;
    animation-delay: -6s;
}

.aurora-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.45) 0%, rgba(16, 185, 129, 0.2) 60%, transparent 80%);
    top: 40%;
    left: 70%;
    animation-duration: 20s;
    animation-delay: -12s;
}

.grid-mesh {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 50% 50%, black 35%, transparent 80%);
}

@keyframes floatAurora {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -35px) scale(1.1); }
    100% { transform: translate(-35px, 45px) scale(0.94); }
}

/* Floating 3D Crystals */
.floating-crystals {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.crystal-item {
    position: absolute;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.08);
}

.crystal-1 {
    width: 75px;
    height: 75px;
    border-radius: 20px;
    top: 18%;
    left: 6%;
    transform: rotate(25deg);
    animation: crystalFloat 10s ease-in-out infinite;
}

.crystal-2 {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    bottom: 22%;
    left: 10%;
    transform: rotate(45deg);
    animation: crystalFloat 13s ease-in-out infinite 2s;
}

.crystal-3 {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    top: 22%;
    right: 8%;
    animation: crystalFloat 11s ease-in-out infinite 1s;
}

@keyframes crystalFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-22px) rotate(8deg); }
}

/* Header Enhancements */
.public-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    width: min(100% - 32px, 1220px);
    margin: 0 auto;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.migration-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.25);
    transition: all 0.25s ease;
}

.migration-nav-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(6, 182, 212, 0.3));
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.6);
}

.migration-nav-btn i {
    color: var(--accent-secondary);
    font-size: 15px;
}

/* 3D Glass Shell Layout */
.login-shell-glass {
    position: relative;
    z-index: 5;
    width: min(100% - 32px, 1140px);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 60px;
    align-items: center;
    padding: 40px 0 60px;
    perspective: 1200px;
}

/* 3D Card Tilt Wrapper */
.glass-tilt-wrapper {
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

.glass-card-panel {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--glass-border);
    border-radius: 26px;
    padding: 34px 30px;
    box-shadow: 
        0 35px 80px rgba(0, 0, 0, 0.65),
        0 0 50px rgba(99, 102, 241, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transform-style: preserve-3d;
}

.glass-card-panel::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 40%, rgba(6, 182, 212, 0.4) 80%, rgba(99, 102, 241, 0.4) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Glass Form Controls */
.glass-field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    transform: translateZ(30px);
}

.field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.field-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--txt-muted);
}

.field-badge {
    font-size: 11px;
    color: var(--accent-secondary);
    font-weight: 600;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.glass-field-control {
    position: relative;
    height: 48px;
    display: flex;
    align-items: center;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.glass-field-control:focus-within {
    border-color: var(--accent-primary);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 
        0 0 0 3px rgba(99, 102, 241, 0.25),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.glass-field-control > i {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 19px;
    flex-shrink: 0;
}

.glass-field-control input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--txt-main);
    font-family: inherit;
    font-size: 14.5px;
    padding-right: 14px;
}

.glass-select {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--txt-main);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding-right: 32px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.glass-select option {
    background: #0f172a;
    color: #ffffff;
    padding: 10px;
}

.select-arrow {
    position: absolute;
    right: 14px;
    color: var(--txt-muted);
    font-size: 18px;
    pointer-events: none;
}

[dir="rtl"] .select-arrow {
    right: auto;
    left: 14px;
}

/* Migration Promo Banner inside Login */
.migration-banner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 20px;
    text-decoration: none;
    color: var(--txt-main);
    transform: translateZ(25px);
    transition: all 0.25s ease;
}

.migration-banner-card:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: rgba(99, 102, 241, 0.55);
    transform: translateZ(32px) translateY(-1px);
}

.migration-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.migration-banner-content {
    flex: 1;
}

.migration-banner-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.migration-banner-desc {
    font-size: 11px;
    color: var(--txt-muted);
    line-height: 1.4;
}

.migration-banner-arrow {
    color: var(--accent-secondary);
    font-size: 16px;
    transition: transform 0.2s ease;
}

.migration-banner-card:hover .migration-banner-arrow {
    transform: translateX(3px);
}

/* Glass Submit Button */
.glass-submit-btn {
    position: relative;
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 50%, var(--accent-secondary) 100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 
        0 12px 28px rgba(99, 102, 241, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateZ(35px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.glass-submit-btn:hover {
    transform: translateZ(42px) scale(1.015);
    box-shadow: 
        0 16px 36px rgba(99, 102, 241, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.glass-submit-btn:active {
    transform: translateZ(28px) scale(0.985);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .login-shell-glass {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 24px 0 40px;
    }
    .login-intro {
        text-align: center;
        max-width: 100%;
    }
    .intro-points {
        justify-content: center;
    }
    .glass-card-panel {
        max-width: 480px;
        margin: 0 auto;
    }
    .floating-crystals {
        display: none;
    }
}
