@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-glass: rgba(26, 26, 46, 0.7);
    --bg-glass-hover: rgba(26, 26, 46, 0.9);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-primary: #0ea5e9;
    --accent-secondary: #3b82f6;
    --accent-gradient: #0ea5e9;
    --accent-gradient-hover: #0284c7;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 300px;
}

[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fb;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-glass-hover: rgba(255, 255, 255, 0.95);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glass-hover: rgba(0, 0, 0, 0.15);
    --text-primary: #1a1a2e;
    --text-secondary: #555566;
    --text-muted: #9999aa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.15);
}

/* Theme-responsive logo switching */
.logo-light {
    display: none !important;
}

.logo-dark {
    display: inline-block !important;
}

[data-theme="light"] .logo-light {
    display: inline-block !important;
}

[data-theme="light"] .logo-dark {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-header .sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-header h1 {
    font-size: 16px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.sidebar-header .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-section h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.mode-toggle {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.mode-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.mode-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: var(--transition);
    outline: none;
}

.select-wrapper select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.upload-area {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.1);
    transform: scale(1.02);
}

.upload-area .upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-area .file-types {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 13px;
    transition: var(--transition);
}

.doc-item:hover {
    background: var(--bg-tertiary);
}

.doc-item .doc-icon {
    font-size: 14px;
}

.doc-item .doc-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.doc-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0;
    transition: var(--transition);
    line-height: 1;
}

.doc-item:hover .doc-delete-btn {
    opacity: 1;
}

.doc-delete-btn:hover {
    color: #ff5f57;
}

.theme-toggle-wrapper {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.theme-toggle span {
    font-size: 13px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-primary);
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}

.toggle-switch.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-switch.active::after {
    left: 22px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.chat-header .header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
}

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

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.chat-welcome .welcome-logo-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    box-shadow: var(--shadow-sm);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.chat-welcome h3 {
    font-size: 22px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-welcome p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
}

.welcome-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.suggestion-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.08);
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--accent-gradient);
}

.message.assistant .message-avatar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glass);
}

.message-content {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.7;
}

.message.user .message-content {
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-bottom-left-radius: 4px;
}

.message-sources {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.source-tag {
    padding: 3px 10px;
    background: rgba(108, 99, 255, 0.12);
    color: var(--accent-primary);
    border-radius: var(--radius-xl);
    font-size: 11px;
    font-weight: 500;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chat-input-area {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 16px;
    transition: var(--transition);
}

.input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.input-container textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    padding: 6px 0;
}

.input-container textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

.toast.info {
    border-left: 3px solid var(--accent-primary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Auth */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .auth-logo-img {
    height: 64px;
    width: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto 16px auto;
    object-fit: contain;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.auth-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.auth-form h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    margin-top: 8px;
}

.auth-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

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

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.api-key-input {
    display: flex;
    gap: 6px;
}

.api-key-input input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.api-key-input input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.api-key-input input::placeholder {
    color: var(--text-muted);
}

.logout-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.logout-btn:hover {
    background: rgba(248, 113, 113, 0.1);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============ RESPONSIVE — Desktop (sidebar always visible, no hamburger) ============ */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: none !important;
    }

    .sidebar {
        position: relative;
        left: 0;
    }
}

/* ============ RESPONSIVE — Tablet & Mobile ============ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    /* Backdrop overlay */
    .sidebar.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .sidebar-toggle {
        display: inline-flex !important;
    }

    .message {
        max-width: 90%;
    }

    .chat-welcome h3 {
        font-size: 18px;
    }

    .chat-welcome p {
        font-size: 13px;
        padding: 0 8px;
    }

    .welcome-suggestions {
        flex-direction: column;
        gap: 6px;
    }

    .suggestion-chip {
        font-size: 12px;
    }

    .chat-input-area {
        padding: 8px;
    }

    .chat-input-area textarea {
        font-size: 14px;
    }

    .auth-container {
        margin: 16px;
        padding: 24px;
    }

    .navbar-title {
        font-size: 14px !important;
    }

    .hero-title {
        font-size: 28px !important;
    }

    .hero-description {
        font-size: 14px !important;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
    }

    .navbar-container {
        padding: 0 16px !important;
    }

    .hero-section {
        flex-direction: column !important;
        padding: 100px 20px 40px !important;
    }

    .hero-content {
        text-align: center !important;
        padding: 0 !important;
    }

    .hero-actions {
        justify-content: center !important;
    }

    .hero-visual {
        display: none !important;
    }

    .features-section,
    .how-section {
        padding: 40px 20px !important;
    }

    .steps-grid {
        flex-direction: column !important;
    }

    .step-connector {
        transform: rotate(90deg) !important;
    }

    .navbar-links {
        display: none !important;
    }

    .cta-section {
        padding: 40px 20px !important;
    }
}

/* ============ LANDING PAGE ============ */
.landing-page {
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-primary);
    position: relative;
}

/* Navbar */
.landing-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    padding: 14px 0;
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

.landing-navbar.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-glass);
}

.navbar-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-logo-img {
    height: 32px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

.navbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.navbar-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-link:hover {
    color: var(--accent-primary);
}

.navbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.navbar-btn {
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border: none;
}

.navbar-btn-ghost {
    background: transparent;
    color: var(--text-primary);
}

.navbar-btn-ghost:hover {
    color: var(--accent-primary);
}

.navbar-btn-primary {
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
}

.navbar-btn-primary:hover {
    background: #5b54e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* Hero */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 120px 40px 60px;
    max-width: 1100px;
    margin: 0 auto;
    overflow: hidden;
}

.hero-decoration {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-decoration-1 {
    width: 300px;
    height: 300px;
    background: rgba(108, 99, 255, 0.08);
    top: 60px;
    right: -60px;
}

.hero-decoration-2 {
    width: 200px;
    height: 200px;
    background: rgba(255, 107, 157, 0.06);
    bottom: 80px;
    left: -40px;
}

.hero-decoration-3 {
    width: 120px;
    height: 120px;
    background: rgba(108, 99, 255, 0.05);
    top: 200px;
    left: 100px;
}

.hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: var(--radius-xl);
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.hero-highlight {
    color: var(--accent-primary);
}

.hero-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.hero-cta {
    padding: 13px 28px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.hero-cta:hover {
    background: #5b54e6;
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.35);
    transform: translateY(-2px);
}

.hero-cta:active {
    transform: translateY(0);
}

.hero-cta-secondary {
    padding: 13px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.hero-cta-secondary:hover {
    color: var(--accent-primary);
}

/* Hero Mockup */
.hero-visual {
    flex: 1;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-mockup {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.mockup-header {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-glass);
}

.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mockup-body {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mockup-msg {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
}

.mockup-user {
    background: var(--accent-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.mockup-ai {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-bottom-left-radius: 4px;
}

.mockup-source {
    font-size: 11px;
    color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    align-self: flex-start;
    font-weight: 500;
}

/* Section Label */
.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

/* Features */
.features-section {
    padding: 80px 40px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.features-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.features-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 48px;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: left;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-glass-hover);
}

.feature-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(108, 99, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon {
    font-size: 22px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* How It Works */
.how-section {
    padding: 80px 40px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.steps-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.step-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    flex: 1;
    max-width: 280px;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    margin: 0 auto 16px;
}

.step-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-connector {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 300;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 80px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.cta-section h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.cta-section p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Footer */
.landing-footer {
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid var(--border-glass);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-brand {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-logo-img {
    height: 20px;
    width: auto;
    border-radius: 4px;
    object-fit: contain;
}

.landing-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Auth Back Button */
.auth-back-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    padding: 10px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.auth-back-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* ============ Custom Confirm Modal ============ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.confirm-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.25s ease;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.confirm-modal h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.confirm-modal p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.confirm-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.confirm-cancel:hover {
    background: var(--bg-primary);
}

.confirm-ok {
    background: #ff5f57;
    color: white;
}

.confirm-ok:hover {
    background: #e5453d;
    transform: translateY(-1px);
}

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

/* API Key Status Badge */
.api-key-status {
    padding: 10px;
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
}

.api-key-badge {
    font-size: 13px;
    color: #34c759;
    font-weight: 500;
}

/* Guide Link */
.guide-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}

.guide-link:hover {
    text-decoration: underline;
}