/* ==========================================================================
   QUIVEX SIGN-IN STYLESHEET
   Description: Modular CSS dedicated to Authentication pages with AI Chat.
   ========================================================================== */

/* 1. Design Tokens */
:root {
    --bg-dark: #0b0d11;
    --bg-accent: #151921;
    --glass-surface: rgba(22, 27, 34, 0.4);
    --glass-border: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --font-main: 'Manrope', sans-serif;
    --navbar-height: 80px;
    --container-width: 1280px;
    --primary-gradient: linear-gradient(135deg, #e2e8f0 0%, #64748b 100%);
    --radius-input: 12px;
    
    /* AI Chatbot Variables */
    --chat-width: 360px;
    --chat-height: 540px;
    --chat-accent: #a78bfa;
}

/* 2. Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-top: var(--navbar-height);
}

html {
    scroll-behavior: smooth;
}

.color-secondary {
    color: var(--text-secondary);
}

.color-muted {
    color: var(--text-muted);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 3. Background Effects */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

.ambient-light {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.light-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.2;
    animation: breathe 15s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 {
    width: 1200px;
    height: 1200px;
    background: radial-gradient(circle, rgba(50, 60, 80, 0.3) 0%, transparent 70%);
    top: -20%;
    left: -20%;
}

.orb-2 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(20, 200, 150, 0.05) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -7s;
}

@keyframes breathe {
    0% {
        opacity: 0.15;
        transform: scale(0.95) translate(0, 0);
    }
    100% {
        opacity: 0.25;
        transform: scale(1.05) translate(30px, -30px);
    }
}

.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: linear-gradient(to bottom, black 20%, transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 90%);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* 4. Header & Navigation */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: rgba(11, 13, 17, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    /* Z-index 10010 to stay on top of everything including chat-backdrop (9998) and chat-modal (10000) */
    z-index: 10010;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-header.scrolled {
    background: rgba(11, 13, 17, 0.9);
    backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.nav-brand-container {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.nav-logo-svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.15));
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-brand-container:hover .nav-logo-svg {
    transform: rotate(360deg) scale(1.1);
}

.nav-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nav-brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-slogan {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 600;
    margin-top: 4px;
}

.nav-right-group,
.top-nav-links {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 40px;
    list-style: none;
}

.top-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.top-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    padding: 8px 0;
    position: relative;
    cursor: pointer;
}

.top-nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(-50%);
}

.top-nav-link:hover::before {
    width: 100%;
}

.top-nav-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.top-nav-link i {
    font-size: 0.7rem;
    margin-top: 1px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.top-nav-item:hover .top-nav-link i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.95);
    background: rgba(18, 21, 26, 0.95);
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6);
    transform-origin: top center;
}

.top-nav-item:last-child .dropdown-menu {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(20px) scale(0.95);
}

.top-nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.top-nav-item:last-child:hover .dropdown-menu {
    transform: translateX(0) translateY(0) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateX(5px);
}

/* Mobile Nav */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    /* Higher than mobile dropdown menu */
    z-index: 10015;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 13, 17, 0.98);
    backdrop-filter: blur(30px);
    /* Mobile Overlay Menu is located right below the header 10010 */
    z-index: 10005;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: calc(var(--navbar-height) + 20px) 24px 30px;
    overflow: hidden;
}

.mobile-nav-overlay.open {
    transform: translateX(0);
}

.mobile-scroll-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    padding-right: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    border: 1px solid transparent;
    margin-bottom: 8px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    padding-left: 25px;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
}

.mobile-dropdown-header {
    justify-content: space-between;
    cursor: pointer;
}

.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding-left: 15px;
    border-left: 1px solid var(--glass-border);
    margin-left: 20px;
    margin-bottom: 10px;
}

.mobile-dropdown-content.open {
    max-height: 500px;
    transition: max-height 0.6s ease-in;
}

.mobile-dropdown-header.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-lang-wrapper {
    display: none;
    position: relative;
}

.mobile-lang-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 10px;
    cursor: pointer;
}

.mobile-lang-btn i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-lang-btn.active i {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.95);
    background: rgba(18, 21, 26, 0.95);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6);
    transform-origin: top center;
    display: none;
}

.mobile-lang-wrapper.open .mobile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    display: block;
}

.flag-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* 5. Form Layout & Architecture */
.signin-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    z-index: 5;
}

.signin-card {
    background: var(--glass-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    animation: floatUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.signin-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
    z-index: 1;
    pointer-events: none;
    animation: shine 8s infinite;
}

@keyframes shine {
    0%, 90% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.welcome-header {
    text-align: center;
    margin-bottom: 36px;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    background: rgba(11, 13, 17, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-input);
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.form-input.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 5;
}

.input-icon:hover {
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}

.forgot-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Buttons */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: #ffffff;
    color: #000000;
    border: 1px solid #ffffff;
    border-radius: var(--radius-input);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled,
.btn-submit.locked {
    background: #2d3139;
    border-color: #2d3139;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-input);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    gap: 12px;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    margin: 24px 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-divider span {
    padding: 0 16px;
}

.register-text {
    text-align: center;
    margin-top: 32px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.register-text a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s;
}

.register-text a:hover {
    border-bottom-color: var(--text-primary);
}

/* Loaders & Toasts */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    margin: 0 auto;
}

.btn-submit.loading span {
    display: none;
}

.btn-submit.loading .spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 2000;
}

.toast {
    background: rgba(15, 17, 21, 0.9);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--error);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 6. Footer Shared Styles */
.main-footer {
    border-top: 1px solid var(--glass-border);
    background: #090a0d;
    padding: 80px 0 40px;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 80px;
    margin-bottom: 60px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.6rem;
}

.footer-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 400px;
    font-size: 1rem;
}

.footer-col h4 {
    color: var(--text-primary);
    font-weight: 800;
    margin-bottom: 24px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-decoration: none !important;
    transition: all 0.3s;
}

.social-icons a:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

/* ==========================================================================
   7. AI CHAT WIDGET
   ========================================================================== */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.chat-toggle-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    color: #ffffff;
    font-size: 1.4rem;
    z-index: 9999;
    box-shadow: 0 10px 30px -10px rgba(167, 139, 250, 0.5);
    animation: ai-pulse 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

@keyframes ai-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(167, 139, 250, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(167, 139, 250, 0);
    }
}

.chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    /* Located below Header (10010) but still covers the rest of the areas */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.chat-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.chat-modal {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: var(--chat-width);
    height: var(--chat-height);
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* Chat modal is located right above the backdrop (9998) but below Header (10010) */
    z-index: 10000;
}

.chat-modal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
    flex-shrink: 0;
}

.chat-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-logo-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-logo-icon {
    font-size: 1.2rem;
}

.chat-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.chat-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-expand-btn,
.chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.chat-expand-btn:hover,
.chat-close:hover {
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.message-bubble {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message-bubble.bot {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-bubble.user {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    font-weight: 500;
    box-shadow: 0 4px 15px -3px rgba(124, 58, 237, 0.4);
}

.message-bubble.bot p {
    margin-bottom: 8px;
}

.message-bubble.bot p:last-child {
    margin-bottom: 0;
}

.message-bubble.bot strong {
    font-weight: 700;
    color: #fff;
}

.typing-indicator {
    display: none;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 12px;
    background: rgba(18, 21, 26, 0.4);
    align-items: flex-end;
}

.chat-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 14px 18px;
    color: #fff;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
    resize: none;
    overflow: hidden;
    min-height: 48px;
    max-height: 120px;
    line-height: 1.4;
}

.chat-input-field:focus {
    border-color: var(--chat-accent);
    background: rgba(255, 255, 255, 0.08);
}

.chat-send-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 8. Media Queries */
@media (max-width: 1024px) {
    .nav-right-group {
        display: none;
    }
    .hamburger-btn {
        display: block;
    }
    .mobile-lang-wrapper {
        display: block;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 50px;
    }
    .main-header {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 90%;
    }
    .signin-card {
        padding: 40px 24px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .nav-brand-name {
        display: block;
    }
    
    /* Mobile Chatbot Adjustments */
    .chat-widget {
        bottom: 0;
        right: 0;
        width: 100%;
        /* Wrapper widget does not overlap the overlay, but the modal inside does */
        z-index: 10000;
        pointer-events: none;
    }
    .chat-toggle-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        pointer-events: auto;
        width: 56px;
        height: 56px;
    }
    .chat-modal {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 85vh;
        max-height: 85%;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        /* Mobile Chat Modal still prioritizes being below Main Header (10010) */
        z-index: 10000;
    }
    .chat-modal.active {
        transform: translateY(0);
    }
    .chat-input-area {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}