/* ═══════════════════════════════════════════════════════════════
   QueryGen – DB Query Portal · Modern Login Page
   Split-panel layout with hero illustration + glassmorphism card
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Font Import ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Custom Properties ─── */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-hero: #080c16;
    --border-card: rgba(139, 92, 246, 0.18);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.4) 0%, rgba(59, 130, 246, 0.4) 100%);
    --input-bg: rgba(15, 23, 42, 0.7);
    --input-border: rgba(100, 116, 139, 0.25);
    --input-focus: rgba(139, 92, 246, 0.5);
    --shadow-card: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(139, 92, 246, 0.08);
    --shadow-button: 0 4px 20px rgba(139, 92, 246, 0.35);
    --shadow-button-hover: 0 8px 35px rgba(139, 92, 246, 0.55);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: stretch;
}

/* ─── Animated Background ─── */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 70% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 30% 70%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
    z-index: 0;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Subtle grid lines */
body.login-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    animation: meshFloat 25s linear infinite;
}

@keyframes meshFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ─── Floating Orbs ─── */
.login-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.login-orb--1 {
    width: 350px;
    height: 350px;
    background: rgba(139, 92, 246, 0.12);
    top: -8%;
    right: 10%;
    animation: orbFloat1 12s ease-in-out infinite alternate;
}

.login-orb--2 {
    width: 250px;
    height: 250px;
    background: rgba(59, 130, 246, 0.10);
    bottom: -5%;
    left: 40%;
    animation: orbFloat2 15s ease-in-out infinite alternate;
}

.login-orb--3 {
    width: 180px;
    height: 180px;
    background: rgba(6, 182, 212, 0.08);
    top: 40%;
    right: 5%;
    animation: orbFloat3 10s ease-in-out infinite alternate;
}

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

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

@keyframes orbFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-20px, -40px) scale(1.15); }
}

/* ═══════════════════════════════════════════════════════
   SPLIT-PANEL LAYOUT
   ═══════════════════════════════════════════════════════ */

.login-split {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ─── Left Hero Panel ─── */
.login-hero {
    flex: 0 0 52%;
    max-width: 52%;
    background: var(--bg-hero);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    position: relative;
    overflow: hidden;
}

/* Gradient overlay on the hero panel */
.login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 40% 50%, rgba(139, 92, 246, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 80% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    z-index: 0;
}

/* Right edge glow line */
.login-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 10%, var(--accent-purple) 30%, var(--accent-blue) 70%, transparent 90%);
    opacity: 0.3;
}

.login-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 520px;
    animation: fadeInLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInLeft {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}

.login-hero-image {
    width: 100%;
    max-width: 440px;
    height: auto;
    margin-bottom: 40px;
    filter: drop-shadow(0 20px 40px rgba(139, 92, 246, 0.15));
    animation: heroFloat 5s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.login-hero-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.login-hero-title span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-hero-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
}

/* Feature pills */
.login-hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.login-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.login-feature-pill:hover {
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.login-feature-pill svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pill-icon-purple { color: var(--accent-purple); }
.pill-icon-blue { color: var(--accent-blue); }
.pill-icon-cyan { color: var(--accent-cyan); }
.pill-icon-emerald { color: var(--accent-emerald); }

/* ─── Right Login Panel ─── */
.login-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow-y: auto;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Glass Card ─── */
.login-card {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 44px 36px 36px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

/* Top gradient accent line */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Subtle inner glow */
.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 100px;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── Logo & Header ─── */
.login-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 16px;
    margin-bottom: 18px;
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.3);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.login-logo svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 5px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.login-header p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* ─── Code badge in header ─── */
.login-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent-emerald);
    letter-spacing: 0.3px;
}

.login-code-badge .code-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Alert Messages ─── */
.login-alerts {
    margin-bottom: 18px;
}

.login-alerts .alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    padding: 11px 14px;
    backdrop-filter: blur(10px);
}

.login-alerts .alert-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-alerts .alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.login-alerts .alert-warning {
    background: rgba(234, 179, 8, 0.12);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.login-alerts .alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ─── Form ─── */
.login-form {
    position: relative;
    z-index: 1;
}

/* ─── Input Groups ─── */
.login-field {
    margin-bottom: 20px;
    position: relative;
}

.login-field label,
.login-field .control-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
    transition: color var(--transition-base);
}

.login-field.is-focused label,
.login-field.is-focused .control-label {
    color: var(--accent-purple);
}

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

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-base);
    z-index: 2;
}

.login-field.is-focused .login-input-icon {
    color: var(--accent-purple);
}

.login-input-wrap input.form-control,
.login-input-wrap input[type="text"],
.login-input-wrap input[type="password"],
.login-input-wrap input[type="email"] {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    outline: none;
    transition: all var(--transition-base);
    -webkit-appearance: none;
    appearance: none;
}

.login-input-wrap input.form-control:hover,
.login-input-wrap input[type="text"]:hover,
.login-input-wrap input[type="password"]:hover,
.login-input-wrap input[type="email"]:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.login-input-wrap input.form-control:focus,
.login-input-wrap input[type="text"]:focus,
.login-input-wrap input[type="password"]:focus,
.login-input-wrap input[type="email"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12), 0 4px 16px rgba(0, 0, 0, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

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

/* Password toggle */
.login-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base);
    z-index: 2;
}

.login-password-toggle:hover {
    color: var(--accent-purple);
}

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

/* Validation errors */
.login-field .help-block {
    font-size: 12px;
    color: #f87171;
    margin-top: 5px;
    display: block;
    animation: shakeIn 0.3s ease-out;
}

@keyframes shakeIn {
    0% { transform: translateX(-5px); opacity: 0; }
    50% { transform: translateX(3px); }
    100% { transform: translateX(0); opacity: 1; }
}

.login-field.has-error input {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}

/* ─── Remember & Forgot Row ─── */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.login-remember {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.login-remember input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.login-remember .login-toggle {
    width: 38px;
    height: 21px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 11px;
    position: relative;
    transition: background var(--transition-base);
    margin-right: 9px;
    flex-shrink: 0;
}

.login-remember .login-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-spring);
}

.login-remember input:checked + .login-toggle {
    background: var(--gradient-primary);
}

.login-remember input:checked + .login-toggle::after {
    left: 20px;
    background: white;
}

.login-remember span:last-child {
    font-size: 12.5px;
    color: var(--text-secondary);
    user-select: none;
}

.login-forgot {
    font-size: 12.5px;
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.login-forgot:hover {
    color: #a78bfa;
    text-decoration: none;
}

/* ─── Submit Button ─── */
.login-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-button);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.6s ease;
}

.login-submit-btn:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-1px);
}

.login-submit-btn:hover::before {
    left: 100%;
}

.login-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.login-submit-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-submit-btn.is-loading .btn-text {
    visibility: hidden;
}

.login-submit-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

@keyframes btnSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ─── Footer Links ─── */
.login-footer {
    text-align: center;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.login-footer p {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 5px 0;
}

.login-footer a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-base);
}

.login-footer a:hover {
    color: #a78bfa;
}

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

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--input-border), transparent);
}

.login-divider span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* ─── Copyright ─── */
.login-copyright {
    text-align: center;
    margin-top: 32px;
}

.login-copyright p {
    font-size: 11.5px;
    color: var(--text-muted);
    opacity: 0.5;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .login-hero {
        flex: 0 0 45%;
        max-width: 45%;
        padding: 40px 30px;
    }

    .login-hero-image {
        max-width: 340px;
    }

    .login-hero-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    body.login-page {
        overflow-y: auto;
    }

    .login-split {
        flex-direction: column;
        min-height: auto;
    }

    .login-hero {
        flex: none;
        max-width: 100%;
        padding: 40px 24px 30px;
    }

    .login-hero::after {
        display: none;
    }

    .login-hero-image {
        max-width: 280px;
        margin-bottom: 24px;
    }

    .login-hero-title {
        font-size: 22px;
    }

    .login-hero-desc {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .login-panel {
        padding: 30px 20px;
    }

    .login-card {
        padding: 32px 24px 28px;
    }
}

@media (max-width: 480px) {
    .login-hero {
        padding: 30px 20px 24px;
    }

    .login-hero-image {
        max-width: 220px;
    }

    .login-hero-title {
        font-size: 20px;
    }

    .login-feature-pill {
        font-size: 11px;
        padding: 6px 12px;
    }

    .login-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-height: 700px) and (min-width: 769px) {
    .login-hero {
        padding: 30px 40px;
    }

    .login-hero-image {
        max-width: 320px;
        margin-bottom: 24px;
    }

    .login-card {
        padding: 30px 30px 26px;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .login-field {
        margin-bottom: 16px;
    }
}

/* ═══════════════════════════════════════════════════════
   OVERRIDE Bootstrap/AdminLTE defaults
   ═══════════════════════════════════════════════════════ */

body.login-page .panel,
body.login-page .panel-default,
body.login-page .panel-heading,
body.login-page .panel-body {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.login-page .row {
    margin: 0;
}

body.login-page .col-md-4,
body.login-page .col-md-offset-4,
body.login-page .col-sm-6,
body.login-page .col-sm-offset-3 {
    width: 100%;
    margin-left: 0;
    padding: 0;
    float: none;
}

body.login-page .form-group {
    margin-bottom: 0;
}

body.login-page .panel-title {
    display: none;
}

body.login-page .text-center {
    margin: 0;
}
