/* ── Login Page Styles ── */

.login-container {
    display: none; min-height: 100vh;
    background: #0b0f1a;
    position: relative; overflow: hidden;
}
.login-container.active { display: flex; }

/* ── Animated mesh gradient background ── */
.login-bg {
    position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.login-bg .orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
    will-change: transform;
}
.login-bg .orb-1 {
    width: 600px; height: 600px; top: -15%; left: -10%;
    background: radial-gradient(circle, #1e40af 0%, transparent 70%);
    animation: orbFloat1 18s ease-in-out infinite;
}
.login-bg .orb-2 {
    width: 500px; height: 500px; bottom: -20%; right: -5%;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    animation: orbFloat2 22s ease-in-out infinite;
}
.login-bg .orb-3 {
    width: 400px; height: 400px; top: 40%; left: 30%;
    background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
    animation: orbFloat3 15s ease-in-out infinite;
}
.login-bg .orb-4 {
    width: 300px; height: 300px; top: 10%; right: 20%;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    animation: orbFloat4 20s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%,100%{transform:translate(0,0) scale(1)} 33%{transform:translate(80px,60px) scale(1.1)} 66%{transform:translate(-40px,30px) scale(0.95)} }
@keyframes orbFloat2 { 0%,100%{transform:translate(0,0) scale(1)} 33%{transform:translate(-60px,-80px) scale(1.05)} 66%{transform:translate(50px,-30px) scale(0.9)} }
@keyframes orbFloat3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(60px,-50px) scale(1.15)} }
@keyframes orbFloat4 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-70px,60px)} }

/* ── Noise texture overlay ── */
.login-bg::after {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat; background-size: 128px 128px; opacity: 0.5; pointer-events: none;
}

/* ── Split layout ── */
.login-split {
    display: flex; width: 100%; min-height: 100vh; position: relative; z-index: 2;
}

/* ── Left branding panel ── */
.login-brand {
    flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 60px 48px; position: relative; overflow: hidden;
    user-select: none; -webkit-user-select: none;
}
.login-brand::after {
    content: ''; position: absolute; inset: 0; z-index: 5;
}
.login-brand-content {
    max-width: 420px; text-align: center;
    animation: fadeSlideUp 0.8s ease-out both;
    pointer-events: none;
}
.brand-icon-ring {
    width: 100px; height: 100px; border-radius: 28px; margin: 0 auto 32px;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(14,165,233,0.15));
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(99,102,241,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.brand-icon-ring .material-icons {
    font-size: 44px; color: #a5b4fc;
}
.brand-icon-ring .custom-icon {
    width: 52px; height: 52px; object-fit: contain;
}
.login-brand h2 {
    font-size: 32px; font-weight: 700; color: #f1f5f9; letter-spacing: -0.5px;
    margin-bottom: 12px; line-height: 1.2;
}
.login-brand .brand-sub {
    font-size: 15px; color: rgba(148,163,184,0.9); line-height: 1.6; max-width: 320px; margin: 0 auto;
}
.brand-features {
    display: flex; flex-direction: column; gap: 14px; margin-top: 40px; text-align: left;
}
.brand-feature {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px;
    background: rgba(255,255,255,0.04); border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    animation: fadeSlideUp 0.8s ease-out both;
}
.brand-feature:nth-child(1) { animation-delay: 0.15s; }
.brand-feature:nth-child(2) { animation-delay: 0.25s; }
.brand-feature:nth-child(3) { animation-delay: 0.35s; }
.brand-feature .material-icons { font-size: 20px; color: #818cf8; flex-shrink: 0; }
.brand-feature span { font-size: 13px; color: #94a3b8; }

/* ── Right form panel ── */
.login-form-panel {
    width: 480px; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 48px; position: relative;
    background: rgba(15,20,35,0.6); backdrop-filter: blur(40px);
    border-left: 1px solid rgba(255,255,255,0.06);
}

.login-box {
    width: 100%; max-width: 360px; position: relative; z-index: 1;
    animation: fadeSlideUp 0.6s ease-out 0.1s both;
}
.login-box .login-greeting {
    font-size: 13px; font-weight: 600; color: #818cf8; text-transform: uppercase;
    letter-spacing: 2px; margin-bottom: 8px;
}
.login-box h1 {
    font-size: 28px; font-weight: 700; color: #f1f5f9; margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.login-box .login-desc {
    font-size: 14px; color: #64748b; margin-bottom: 32px; line-height: 1.5;
}

.form-group { margin-bottom: 22px; position: relative; }
.form-group label {
    display: block; margin-bottom: 8px; font-weight: 500;
    color: #94a3b8; font-size: 13px; letter-spacing: 0.3px;
}
.form-group .input-wrapper {
    position: relative;
}
.form-group .input-wrapper .material-icons {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 20px; color: #475569; transition: color 0.2s; pointer-events: none;
}
.form-group input {
    width: 100%; padding: 14px 16px 14px 46px;
    border: 1.5px solid rgba(255,255,255,0.08); border-radius: 12px;
    font-size: 15px; transition: all 0.25s ease;
    background: rgba(255,255,255,0.04); color: #e2e8f0;
}
.form-group input::placeholder { color: #475569; }
.form-group input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15), 0 2px 8px rgba(99,102,241,0.1);
    background: rgba(255,255,255,0.06);
}
.form-group input:focus + .material-icons,
.form-group .input-wrapper:focus-within .material-icons { color: #818cf8; }

.login-box .btn-primary {
    width: 100%; height: 50px; font-size: 15px; margin-top: 8px; border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none; color: white; font-weight: 600; letter-spacing: 0.3px;
    transition: all 0.3s ease; position: relative; overflow: hidden;
}
.login-box .btn-primary:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}
.login-box .btn-primary:active { transform: translateY(0); }
.login-box .btn-primary:disabled {
    background: rgba(99,102,241,0.3); cursor: not-allowed;
    box-shadow: none; transform: none;
}

.error-msg {
    background: rgba(239,68,68,0.1); color: #f87171;
    padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
    display: none; font-size: 13px; border: 1px solid rgba(239,68,68,0.15);
    backdrop-filter: blur(10px);
}
.error-msg.show { display: flex; align-items: center; gap: 8px; }
.error-msg .material-icons { font-size: 18px; flex-shrink: 0; }

.login-footer {
    margin-top: 32px; text-align: center; font-size: 12px; color: #475569;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Login mobile responsive ── */
@media (max-width: 900px) {
    .login-split { flex-direction: column; }
    .login-brand {
        padding: 40px 24px 32px; min-height: auto;
        height: 260px; box-sizing: border-box;
        justify-content: center;
    }
    .brand-features { display: none; }
    .login-brand h2 { font-size: 24px; line-height: 32px; }
    .login-brand .brand-sub { line-height: 22px; }
    .brand-icon-ring { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 20px; }
    .brand-icon-ring .material-icons { font-size: 34px; }
    .brand-icon-ring .custom-icon { width: 38px; height: 38px; }
    .login-form-panel {
        width: 100%; min-height: auto; flex: 1;
        border-left: none; border-top: 1px solid rgba(255,255,255,0.06);
        padding: 32px 24px 48px;
    }
}

@media (max-width: 640px) {
    .login-bg .orb { filter: blur(60px); opacity: 0.35; }
}

/* ── Language switch button (login page) ── */
.lang-switch-login {
    position: absolute; z-index: 10; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 82px; height: 32px; border-radius: 20px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    color: #94a3b8; font-size: 13px; font-weight: 500; line-height: 1;
    backdrop-filter: blur(12px);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.lang-switch-login:hover {
    background: rgba(255,255,255,0.14); color: #e2e8f0;
    border-color: rgba(255,255,255,0.2);
}
.lang-switch-login .material-icons { font-size: 18px; }
/* PC: bottom-left */
@media (min-width: 901px) {
    .lang-switch-login { bottom: 24px; left: 24px; }
}
/* Mobile: top-left */
@media (max-width: 900px) {
    .lang-switch-login { top: 16px; left: 16px; }
}

/* ── Login re-enter animation on lang switch ── */
@keyframes fadeReA {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeReB {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-brand-content.re-a { animation: fadeReA 0.6s ease-out both !important; }
.login-brand-content.re-b { animation: fadeReB 0.6s ease-out both !important; }
.login-box.re-a { animation: fadeReA 0.55s ease-out 0.08s both !important; }
.login-box.re-b { animation: fadeReB 0.55s ease-out 0.08s both !important; }
.login-brand-content.re-a .brand-feature:nth-child(1) { animation: fadeReA 0.5s ease-out 0.12s both !important; }
.login-brand-content.re-a .brand-feature:nth-child(2) { animation: fadeReA 0.5s ease-out 0.22s both !important; }
.login-brand-content.re-a .brand-feature:nth-child(3) { animation: fadeReA 0.5s ease-out 0.32s both !important; }
.login-brand-content.re-b .brand-feature:nth-child(1) { animation: fadeReB 0.5s ease-out 0.12s both !important; }
.login-brand-content.re-b .brand-feature:nth-child(2) { animation: fadeReB 0.5s ease-out 0.22s both !important; }
.login-brand-content.re-b .brand-feature:nth-child(3) { animation: fadeReB 0.5s ease-out 0.32s both !important; }

/* ── Registration Page ── */
.register-container {
    display: none; min-height: 100vh;
    background: #0b0f1a;
    position: relative; overflow: hidden;
}
.register-container.active { display: flex; }

/* Registration form: tighter spacing for 3 inputs */
.reg-box .form-group { margin-bottom: 16px; }
.reg-box .login-desc { margin-bottom: 24px; }

/* Password requirements checklist */
.password-requirements {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 20px; padding: 12px 14px;
    background: rgba(255,255,255,0.03); border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}
.req-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: #64748b; line-height: 1.4;
    transition: color 0.25s ease;
}
.req-item .material-icons {
    font-size: 16px; flex-shrink: 0;
    transition: color 0.25s ease;
}
.req-item.pass { color: #34d399; }
.req-item.pass .material-icons { color: #34d399; }
.req-item.fail { color: #f87171; }
.req-item.fail .material-icons { color: #f87171; }

/* Registration mobile adjustments */
@media (max-width: 900px) {
    .register-container .login-form-panel { padding: 24px 24px 40px; }
    .reg-box .form-group { margin-bottom: 14px; }
    .reg-box .login-desc { margin-bottom: 20px; }
}
