/* ============================================
   SNRU SmartHub Login Page
============================================ */
:root {
    --tt-primary: #6366f1;
    --tt-primary-dark: #4f46e5;
    --tt-secondary: #0ea5e9;
}

body {
    font-family: 'IBM Plex Sans Thai', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    background: #f0f2f8;
    overflow: hidden;
}

/* Left Panel - Branding */
.login-branding {
    flex: 1;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4f46e5 70%, #0ea5e9 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 500px; height: 500px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.login-branding::after {
    content: '';
    position: absolute;
    bottom: -150px; left: -100px;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

/* Floating elements */
.float-el {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: #fff;
}

.float-el:nth-child(1) { width: 80px; height: 80px; top: 15%; left: 10%; animation: float 8s ease-in-out infinite; }
.float-el:nth-child(2) { width: 120px; height: 120px; top: 60%; right: 15%; animation: float 10s ease-in-out infinite reverse; }
.float-el:nth-child(3) { width: 60px; height: 60px; bottom: 20%; left: 30%; animation: float 7s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

.brand-content { position: relative; z-index: 2; text-align: center; max-width: 450px; }

.brand-logo-container {
    width: 140px; height: 140px;
    background: rgba(255,255,255,1);
    border-radius: 30px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 30px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 15px;
}
.brand-logo-container img {
    width: 100%; height: auto;
}

.brand-title {
    font-family: 'Inter', sans-serif;
    font-size: 3rem; font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.brand-subtitle {
    font-size: 1.1rem; opacity: 0.85;
    margin-bottom: 10px; font-weight: 300;
    letter-spacing: 0.3px;
}

.brand-slogan {
    font-size: 0.9rem; opacity: 0.6;
    font-style: italic;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.brand-features {
    margin-top: 40px;
    text-align: left;
}

.brand-feature {
    display: flex; align-items: center;
    gap: 14px; margin-bottom: 16px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.brand-feature i {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Right Panel - Form */
.login-form-panel {
    width: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background: #fff;
}

.login-card { max-width: 400px; margin: 0 auto; width: 100%; }

.login-card h3 {
    font-weight: 700; color: #1e293b;
    margin-bottom: 6px; font-size: 1.6rem;
}

.login-card .subtitle {
    color: #64748b; font-size: 0.9rem;
    margin-bottom: 35px;
}

.btn-back {
    position: absolute;
    top: 30px;
    right: 30px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.btn-back:hover {
    background: #fff;
    color: var(--tt-primary);
    border-color: var(--tt-primary);
    box-shadow: 0 4px 12px rgba(99,102,241,0.1);
    transform: translateY(-2px);
}

.form-label {
    font-weight: 600; color: #475569;
    font-size: 0.85rem; margin-bottom: 6px;
}

.form-control {
    border-radius: 12px; padding: 12px 16px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s; background: #fff;
    font-size: 0.92rem;
}

.form-control:focus {
    border-color: var(--tt-primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.08);
    background: #fff;
}

.form-control::placeholder { color: #cbd5e1; }

.input-group-text {
    background: transparent;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: #94a3b8;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

/* If form-control is in the middle (has a sibling after it like the eye button) */
.input-group .form-control:not(:last-child) {
    border-right: none;
    border-radius: 0;
}

.input-group .form-control:focus {
    box-shadow: none;
    outline: none;
}

.btn-eye-toggle {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-left: none;
    border-radius: 0 12px 12px 0 !important;
    transition: all 0.2s;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control,
.input-group:focus-within .btn-eye-toggle {
    border-color: var(--tt-primary) !important;
    color: var(--tt-primary) !important;
    background: #fff !important;
    box-shadow: none;
    outline: none;
}

#togglePasswordBtn:hover {
    color: var(--tt-primary) !important;
}

#togglePasswordBtn:focus {
    box-shadow: none;
}

.btn-login {
    background: linear-gradient(135deg, var(--tt-primary), var(--tt-primary-dark));
    color: #fff; border: none;
    border-radius: 12px; padding: 14px;
    width: 100%; font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(99,102,241,0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99,102,241,0.4);
    color: #fff;
}

.btn-login:active { transform: translateY(0); }

.login-footer {
    text-align: center; margin-top: 40px;
    font-size: 0.8rem; color: #94a3b8;
}

.login-footer a { color: var(--tt-primary); text-decoration: none; }

/* Animation */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card { animation: slideUp 0.5s ease-out; }

/* Responsive */
@media (max-width: 991.98px) {
    body { flex-direction: column; overflow-y: auto; }
    .login-branding { min-height: 300px; padding: 40px 30px; }
    .brand-features { display: none; }
    .brand-title { font-size: 2.2rem; }
    .login-form-panel { width: 100%; padding: 40px 30px; position: relative; }
    .btn-back { top: 20px; right: 20px; }
}

@media (max-width: 575.98px) {
    .login-branding { min-height: 220px; padding: 30px 20px; }
    .brand-logo { width: 60px; height: 60px; font-size: 1.5rem; margin-bottom: 16px; }
    .brand-title { font-size: 1.8rem; letter-spacing: 2px; }
    .brand-subtitle { font-size: 0.88rem; }
    .login-form-panel { padding: 30px 20px; }
}
