:root {
    --benrica-green: #10b981;
    --benrica-dark-green: #059669;
    --benrica-teal: #14b8a6;
    --primary-color: var(--benrica-green);
    --dark-bg: #0a0a0a;
    --darker-bg: #000000;
    --modal-dark-navy: #0f172a;
    --text-white: #FFFFFF;
    --text-gray: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --transition-speed: 0.3s;
    --base-font-size: 14.4px;
    /* 10% less than 16px */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    font-size: var(--base-font-size);
    overflow-x: hidden;
}

h1,
h2,
h3,
.brand-name,
.overlay-title {
    font-family: 'Outfit', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--benrica-green);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.logo {
    color: var(--benrica-green);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: white;
    font-weight: 300;
    margin-left: 4px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 18px;
}

nav ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

nav ul li a:hover {
    color: var(--benrica-green);
}

.user-profile img {
    width: 30px;
    height: 30px;
    border-radius: 4px;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name-display {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-logout svg {
    opacity: 0.7;
}

/* Hero Section */
.hero {
    height: 75vh;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 100%),
        url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.hero-content h1 {
    font-size: 3.5rem;
    max-width: 600px;
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
}

.hero-content p {
    font-size: 1.15rem;
    color: #ccc;
    max-width: 500px;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--benrica-green) 0%, var(--benrica-dark-green) 100%);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Module Grid */
.module-section {
    padding: 60px 50px;
    margin-top: -100px;
    position: relative;
    z-index: 10;
}

.module-section h2 {
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.module-card {
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    aspect-ratio: 16/9;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.module-card:hover {
    transform: scale(1.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 20;
    border-color: var(--benrica-green);
}

.module-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: 0.4s;
}

.module-card:hover .module-image {
    opacity: 0.9;
}

.module-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
}

.module-info h3 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.module-info p {
    font-size: 0.75rem;
    color: #aaa;
    opacity: 0;
    transform: translateY(5px);
    transition: 0.3s;
}

.module-card:hover .module-info p {
    opacity: 1;
    transform: translateY(0);
}

.badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--benrica-green);
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    z-index: 5;
}

.module-completed-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--benrica-green) 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/*
========================================
MODAL REFINEMENTS
========================================
*/
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(12px);
    animation: fadeInModal 0.3s ease;
}

.modal-content.premium-layout {
    background-color: var(--modal-dark-navy);
    color: #f1f5f9;
    margin: 2vh auto;
    width: 95%;
    max-width: 1050px;
    height: 96vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Header */
.premium-header {
    background: rgba(15, 23, 42, 0.3);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn,
.history-back-btn {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover,
.history-back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(-2px);
}

.ai-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.05);
}

.brand-icon svg {
    width: 20px;
    height: 20px;
    color: var(--benrica-green);
}

.brand-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.brand-step {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Tabs */
.steps-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.1);
    padding: 12px 25px;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
    overflow-x: auto;
}

.tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.tab.active {
    background: rgba(16, 185, 129, 0.08);
    color: var(--benrica-green);
    border-color: rgba(16, 185, 129, 0.2);
}

.tab.active svg {
    opacity: 1;
    color: var(--benrica-green);
}

.tab.locked {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Modal Body / Chat Area */
#modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0c1120;
    overflow: hidden;
    min-height: 0;
}

.ai-conversation {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

.message {
    max-width: 82%;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.typing-indicator {
    padding: 10px 18px;
    font-size: 0.65rem;
    color: var(--text-gray);
    font-style: italic;
    animation: fadeIn 0.3s ease;
}

.ai-msg {
    align-self: flex-start;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-top-left-radius: 2px;
}

.user-msg {
    align-self: flex-end;
    background: var(--benrica-green);
    color: white;
    border-top-right-radius: 2px;
    font-weight: 500;
}

/* Action Buttons in Chat */
.chat-action-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 15px 0;
    animation: fadeIn 0.4s ease;
    flex-shrink: 0;
}

/* Input */
.ai-input-area {
    padding: 12px 30px 20px;
    background: var(--modal-dark-navy);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    color: white;
    outline: none;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.2s;
}

#user-input:focus {
    border-color: var(--benrica-green);
    background: rgba(255, 255, 255, 0.04);
}

#send-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--benrica-green);
    border: none;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#send-btn svg {
    width: 18px;
    height: 18px;
}

/* Master Plan Overlay (Advanced Concepts) */
.master-plan-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    z-index: 500;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.overlay-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.overlay-title {
    font-weight: 800;
    color: var(--benrica-green);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.close-overlay-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.premium-glass-card {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.02);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    line-height: 1.8;
    color: #f1f5f9;
    font-size: 0.95rem;
    white-space: pre-wrap;
    backdrop-filter: blur(20px);
}

.overlay-footer {
    padding: 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.overlay-footer .btn {
    padding: 15px 40px;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

/* Typo reduction 10% refinement */
/* Global Typography Overrides for 10% reduction */
h1 {
    font-size: 3.15rem !important;
}

h2 {
    font-size: 1.44rem !important;
}

h3 {
    font-size: 0.85rem !important;
}

.message {
    font-size: 0.81rem !important;
}

#user-input {
    font-size: 0.81rem !important;
}

.btn {
    font-size: 0.76rem !important;
}

.brand-name {
    font-size: 0.85rem !important;
}

.tab {
    font-size: 0.72rem !important;
}

.badge {
    font-size: 0.58rem !important;
}

.progress-text {
    font-size: 0.65rem !important;
}

/* Completion */
.completion-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-dark-navy);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 50px 30px;
    overflow-y: auto;
}

.completion-content {
    width: 100%;
    max-width: 720px;
    margin: auto;
    text-align: center;
}

.completion-content h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

.glass-summary {
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    line-height: 1.7;
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    white-space: pre-wrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 
========================================
MOBILE RESPONSIVENESS
========================================
*/
@media (max-width: 768px) {

    /* Navbar compacta */
    .navbar {
        padding: 15px 20px;
    }

    .logo {
        font-size: 18px;
    }

    nav ul {
        gap: 10px;
    }

    nav ul li a {
        font-size: 12px;
    }

    /* Hero adjustments */
    .hero {
        padding: 0 20px;
        height: auto;
        min-height: 80vh;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.2rem !important;
        margin-top: 80px;
    }

    .hero-content p {
        font-size: 1rem;
        margin: 0 auto 25px;
    }

    .hero-content .btn {
        margin: 0 auto;
    }

    /* Module Grid Mobile */
    .module-section {
        padding: 40px 20px;
    }

    .module-grid {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
    }

    /* FULL SCREEN MODAL ON MOBILE */
    .modal-content.premium-layout {
        width: 100%;
        height: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
    }

    .premium-header {
        padding: 12px 15px;
    }

    .steps-tabs {
        padding: 10px 15px;
    }

    .tab {
        font-size: 0.75rem !important;
        /* Slightly larger targets */
        padding: 8px 12px;
    }

    .ai-conversation {
        padding: 15px;
    }

    .message {
        max-width: 90%;
        font-size: 0.9rem !important;
    }

    .ai-input-area {
        padding: 10px 15px 15px;
    }

    #user-input {
        padding: 12px;
        font-size: 16px !important;
        /* Prevent iOS zoom */
    }

    /* Master Plan Overlay Mobile */
    .master-plan-overlay {
        width: 100%;
    }

    .premium-glass-card {
        padding: 20px;
        font-size: 0.9rem;
    }
}