/* public/assets/css/login.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: #0b1120;
    position: relative;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

/* ===== LIGHT THEME ===== */
body.light-theme {
    background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 55%, #bfdbfe 100%);
}

body.light-theme .login-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(37, 99, 235, 0.14);
    box-shadow: 0 40px 80px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.light-theme .login-card:hover {
    box-shadow: 0 50px 100px rgba(37, 99, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.light-theme .login-card .login-heading h1 { color: #0b1120; }
body.light-theme .login-card .login-heading p { color: #55657d; }
body.light-theme .form-group label { color: #4d5e7a; }

body.light-theme .input-wrapper {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.12);
}

body.light-theme .input-wrapper:focus-within {
    background: rgba(37, 99, 235, 0.08);
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

body.light-theme .input-wrapper .input-icon { color: rgba(11, 17, 32, 0.3); }
body.light-theme .input-wrapper:focus-within .input-icon { color: #4f46e5; }
body.light-theme .input-wrapper input { color: #0b1120; }
body.light-theme .input-wrapper input::placeholder { color: rgba(11, 17, 32, 0.3); }
body.light-theme .password-toggle { color: rgba(11, 17, 32, 0.3); }
body.light-theme .password-toggle:hover { color: rgba(11, 17, 32, 0.6); }
body.light-theme .status-message { color: rgba(11, 17, 32, 0.4); }
body.light-theme .status-message.success { color: #0d9e6f; }
body.light-theme .status-message.error { color: #dc2626; }
body.light-theme .login-footer { color: rgba(11, 17, 32, 0.35); border-top-color: rgba(11, 17, 32, 0.08); }
body.light-theme .input-wrapper::after { background: linear-gradient(90deg, transparent, #4f46e5, transparent); }
body.light-theme .bg-animation .orb { opacity: 0.35; }

body.light-theme .alert-error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

body.light-theme .login-side {
    background: rgba(191, 219, 254, 0.25);
}

body.light-theme .footer-credit {
    color: rgba(11, 17, 32, 0.4);
}

body.light-theme .footer-credit a {
    color: rgba(11, 17, 32, 0.55);
}

body.light-theme .footer-credit a:hover {
    color: #4f46e5;
}

body.light-theme .footer-credit .heart {
    color: #dc2626;
}

/* ===== LEFT PANEL: fixed dark styling regardless of theme ===== */
.features-card {
    background: linear-gradient(160deg, #1e1b4b 0%, #2e1065 50%, #1e1b4b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.features-card .brand .logo-text { color: #ffffff; }
.slide h2 { color: #ffffff; }
.slide p { color: rgba(255, 255, 255, 0.55); }

.slide .feature-tag {
    background: rgba(129, 140, 248, 0.12);
    color: #a78bfa;
    border-color: rgba(129, 140, 248, 0.16);
}

.slide-dots .dot { background: rgba(255, 255, 255, 0.25); }
.slide-dots .dot.active { background: #ffffff; }
.slide-dots .dot:hover { background: rgba(255, 255, 255, 0.5); }

.theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.06);
}

.theme-toggle:hover { background: rgba(255, 255, 255, 0.1); }

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-animation .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 20s ease-in-out infinite alternate;
}

.bg-animation .orb:nth-child(1) {
    width: 500px; height: 500px;
    background: #4f46e5;
    top: -10%; left: -5%;
}

.bg-animation .orb:nth-child(2) {
    width: 400px; height: 400px;
    background: #7c3aed;
    bottom: -10%; right: -5%;
    animation-delay: -7s;
}

.bg-animation .orb:nth-child(3) {
    width: 320px; height: 320px;
    background: #06b6d4;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.2;
}

body.light-theme .bg-animation .orb:nth-child(1) { background: #6366f1; opacity: 0.4; }
body.light-theme .bg-animation .orb:nth-child(2) { background: #8b5cf6; opacity: 0.35; }
body.light-theme .bg-animation .orb:nth-child(3) { background: #06b6d4; opacity: 0.3; }

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, -60px) scale(1.2); }
}

.grid-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

body.light-theme .grid-overlay {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

/* ===== SPLIT-SCREEN LAYOUT ===== */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(160deg, #1e1b4b 0%, #2e1065 50%, #1e1b4b 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
}

.mobile-header .brand { display: flex; align-items: center; gap: 10px; }

.mobile-header .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px; flex-shrink: 0;
}

.mobile-header .logo-text { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; color: #ffffff; }
.mobile-header .theme-toggle { width: 36px; height: 36px; font-size: 15px; }

/* LEFT COLUMN */
.features-card {
    flex: 1 1 50%;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 56px 64px 48px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.top-bar {
    position: absolute;
    top: 28px; right: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.theme-toggle {
    width: 44px; height: 44px;
    border-radius: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    flex-shrink: 0;
}

/* Clock badge — sits in the top-bar next to the theme toggle. Fixed-dark styling
   since it lives on the features panel, which never changes with the theme toggle. */
.clock-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 14px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.clock-badge i {
    font-size: 15px;
    color: #a78bfa;
}

.clock-badge .time {
    font-weight: 700;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.clock-badge .date {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
}

.clock-badge .divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-header .clock-badge {
    padding: 6px 14px 6px 12px;
}

.mobile-header .clock-badge .time {
    font-size: 13px;
}

.features-card .brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.features-card .brand .logo-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.features-card .brand .logo-text {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.5px;
    transition: color 0.4s ease;
}

/* Slideshow */
.slideshow-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.slide { display: none; animation: fadeIn 0.6s ease; }
.slide.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide .slide-icon {
    font-size: 52px;
    color: #818cf8;
    margin-bottom: 18px;
    display: block;
}

.slide h2 {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    transition: color 0.4s ease;
}

.slide p {
    font-size: 16px;
    line-height: 1.7;
    max-width: 460px;
    transition: color 0.4s ease;
}

.slide .feature-tag {
    display: inline-block;
    margin-top: 18px;
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.slide-dots {
    display: flex;
    gap: 12px;
    margin-top: 36px;
    position: relative;
    z-index: 1;
}

.slide-dots .dot {
    width: 10px; height: 10px;
    border-radius: 40px;
    cursor: pointer;
    border: none;
    transition: background 0.3s ease, width 0.3s ease;
}

.slide-dots .dot.active { width: 32px; }

/* RIGHT COLUMN */
.login-side {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
    background: rgba(11, 17, 32, 0.4);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 40px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease, border-color 0.4s ease;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-card .login-heading { margin-bottom: 24px; }

.login-card .login-heading h1 {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    transition: color 0.4s ease;
}

.login-card .login-heading p {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    font-size: 14px;
    transition: color 0.4s ease;
}

/* Server-side error alert (rendered when PHP $error is set) */
.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.alert-error i { font-size: 15px; flex-shrink: 0; }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.3px;
    transition: color 0.4s ease;
}

.form-group label i { margin-right: 6px; }

.input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.input-wrapper .input-icon {
    padding: 0 12px 0 16px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 14px;
    transition: 0.3s;
}

.input-wrapper:focus-within .input-icon { color: #818cf8; }

.input-wrapper input {
    border: none;
    background: transparent;
    padding: 14px 16px 14px 0;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    outline: none;
    width: 100%;
    font-family: 'Inter', sans-serif;
    transition: color 0.4s ease;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 400;
}

.password-toggle {
    padding-right: 16px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    font-size: 14px;
}

.password-toggle:hover { color: rgba(255, 255, 255, 0.5); }

.login-btn {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.3);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: 0.6s;
}

.login-btn:hover::before { left: 100%; }

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(79, 70, 229, 0.4);
}

.login-btn:active { transform: translateY(0); }
.login-btn i { font-size: 16px; transition: transform 0.3s ease; }
.login-btn:hover i { transform: translateX(4px); }
.login-btn:disabled { cursor: not-allowed; opacity: 0.85; }

.login-btn .btn-spinner {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    animation: spin 0.7s linear infinite;
    display: none;
}

.login-btn.is-loading .btn-spinner { display: inline-block; }

.login-btn.is-loading > span:not(.btn-spinner),
.login-btn.is-loading > i { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.input-wrapper.has-error {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12) !important;
}

.field-error {
    font-size: 12px;
    color: #f87171;
    margin-top: 2px;
    display: none;
}

.field-error.visible { display: block; }

.status-message {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
    min-height: 20px;
    transition: 0.3s;
}

.status-message.success { color: #34d399; }
.status-message.error { color: #f87171; }

.login-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.2px;
    text-align: center;
    transition: color 0.4s ease, border-color 0.4s ease;
}

.footer-credit {
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.4s ease;
}

.footer-credit .heart {
    color: #f87171;
    margin: 0 2px;
}

.footer-credit a {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-credit a:hover {
    color: #a78bfa;
}

.input-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #818cf8, transparent);
    transition: 0.4s ease;
    transform: translateX(-50%);
    border-radius: 4px;
}

.input-wrapper:focus-within::after { width: 60%; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake { animation: shake 0.4s ease; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .login-side { padding: 32px; }
    .features-card { padding: 44px 40px 40px; }
    .top-bar { top: 20px; right: 24px; }
    .slide h2 { font-size: 27px; }
    .slide p { font-size: 15px; }
}

@media (max-width: 860px) {
    .login-wrapper { flex-direction: column; }
    .mobile-header { display: flex; }
    .features-card { display: none; }
    .login-side {
        flex: 1 1 auto;
        min-height: calc(100vh - 68px);
        padding: 24px;
    }
    .login-card {
        border-radius: 32px;
        padding: 28px 24px 24px;
        max-width: 480px;
    }
    .login-card .login-heading h1 { font-size: 22px; }
}

@media (max-width: 480px) {
    .login-side { padding: 16px; }
    .login-card { border-radius: 28px; padding: 20px 16px 20px; }
    .login-card .login-heading h1 { font-size: 20px; }
    .login-card .login-heading p { font-size: 13px; }
    .input-wrapper input { padding: 12px 12px 12px 0; font-size: 13px; }
    .login-btn { padding: 14px 16px; font-size: 14px; }
    .login-footer { font-size: 11px; margin-top: 16px; padding-top: 12px; }
}