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

:root {
    /* Main B2B Trust Colors */
    --navy-dark: #0F172A;
    --navy-main: #1E293B;
    --royal-blue: #2563EB;
    --royal-hover: #1D4ED8;
    
    /* Vibrant Youth/Action Accents */
    --mint-green: #0D9488;
    --mint-hover: #0F766E;
    --soft-orange: #F97316;
    
    /* UI Neutrals */
    --bg-light: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --border-soft: #E2E8F0;
    --text-heading: #0F172A;
    
    /* Design System */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-floating: 0 20px 40px -5px rgba(37, 99, 235, 0.15);
    
    --font-fam: 'Nunito', sans-serif;
    --nav-height: 90px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-fam);
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; font-weight: 700; }
p { font-size: 1rem; color: var(--text-secondary); }

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--royal-blue);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}
.btn-primary:hover {
    background-color: var(--royal-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-accent {
    background-color: var(--mint-green);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(13, 148, 136, 0.3);
}
.btn-accent:hover {
    background-color: var(--mint-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.3);
}


.btn-outline {
    border: 2px solid var(--border-soft);
    color: var(--navy-main);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--royal-blue);
    color: var(--royal-blue);
    background: var(--card-bg);
}

/* =========================================
   NAVIGATION (GLOBAL)
   ========================================= */
/* =========================================
   NAVIGATION (GLOBAL) - REDISEÑADO
   ========================================= */
.navbar-global {
    position: sticky;
    top: 0;
    z-index: 9999;
    height: 80px;
    background-color: var(--navy-dark, #0F172A);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-global .nav-left {
    display: flex;
    align-items: center;
    flex: 1; /* Para mantener el centro al medio */
}

.navbar-global .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-global .nav-brand i {
    color: var(--royal-blue, #2563EB);
    font-size: 1.75rem;
}

.navbar-global .nav-center {
    display: flex;
    align-items: center;
    gap: 32px;
    justify-content: center;
    flex: 2; /* Espacio central */
}

.navbar-global .nav-center .nav-link {
    color: #CBD5E1;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.navbar-global .nav-center .nav-link:hover {
    color: white;
}

.navbar-global .nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-end;
    flex: 1; /* Balance derecho */
}

.navbar-global .nav-link-b2b {
    color: #94A3B8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.navbar-global .nav-link-b2b:hover {
    color: white;
}

.navbar-global .btn-primary-outline {
    border: 1px solid rgba(37, 99, 235, 0.5);
    color: #BFDBFE;
    background: transparent;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.navbar-global .btn-primary-outline:hover {
    border-color: var(--royal-blue, #2563EB);
    color: white;
    background: rgba(37, 99, 235, 0.1);
}

.navbar-global .btn-accent-b2b {
    background: var(--royal-blue, #2563EB);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
}

.navbar-global .btn-accent-b2b:hover {
    background: var(--royal-hover, #1D4ED8);
    transform: translateY(-1px);
}

.navbar-global .theme-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.navbar-global .theme-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Botón Iniciar Sesión en Navbar */
.navbar-global .btn-login {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.4);
    color: #BFDBFE;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    white-space: nowrap;
}
.navbar-global .btn-login:hover {
    background: var(--royal-blue);
    border-color: var(--royal-blue);
    color: white;
    transform: translateY(-1px);
}

/* Botón Mensajes / Buzón en Navbar */
.navbar-global .nav-messages-btn {
    position: relative;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E1;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 1.1rem;
}
.navbar-global .nav-messages-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255,255,255,0.3);
}
.navbar-global .nav-messages-btn .msg-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #EF4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--navy-dark);
    display: none;
}

/* Modo Responsive Básico para el Navbar */
@media (max-width: 1024px) {
    .navbar-global .nav-center { display: none; }
    .navbar-global .nav-link-b2b, .navbar-global .btn-primary-outline { display: none; }
    .navbar-global .nav-right { flex: auto; }
}


/* Mega-Menu Dropdown removed per user request */

.uni-partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.uni-partner-card i {
    font-size: 2rem;
    color: var(--royal-blue);
    margin-bottom: 8px;
}
.uni-partner-card span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
}
.uni-partner-card:hover {
    background: var(--card-bg);
    border-color: var(--mint-green);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}
.uni-partner-card:hover i {
    color: var(--mint-green);
}

.nav-b2b-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.nav-b2b-cta .publishing-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}
.nav-b2b-cta .highlight {
    color: var(--mint-green);
    font-weight: 800;
}

/* =========================================
   HERO & SEARCH (LANDING PAGE)
   ========================================= */
.hero-section {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.4)), url('hero-bg.png');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    padding: 0 10%;
    text-align: left;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    width: 100%;
}

.hero-title {
    color: white;
    margin-bottom: 24px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 3.5rem;
}

.hero-subtitle {
    color: #F8FAFC;
    font-size: 1.25rem;
    margin-bottom: 40px;
    font-weight: 500;
    max-width: 500px;
}


/* Massive Search Box */
.search-container:focus-within {
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.search-input-group {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    position: relative;
    border: 1px solid var(--border-soft);
    transition: all 0.2s ease;
}

.search-input-group:hover {
    border-color: var(--royal-blue);
    background: #F8FAFC;
}


.search-input-group i.main-icon {
    font-size: 1.25rem;
    color: var(--royal-blue);
    margin-right: 12px;
}

.styled-select {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    font-family: var(--font-fam);
    font-weight: 600;
    color: var(--text-heading);
    background: transparent;
    cursor: pointer;
    appearance: none;
}

.search-btn {
    height: 60px;
    width: 100%;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    background: var(--royal-blue);
}

/* QUICK LINKS SECTION */
.quick-links-section {
    padding: 60px 10%;
    background: var(--bg-light);
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin-bottom: 40px;
}

.quick-link-card {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
}

.quick-link-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--royal-blue);
}

.quick-link-card i {
    font-size: 2.5rem;
    color: var(--royal-blue);
}

.quick-link-card h3 {
    font-size: 1.5rem;
    margin: 0;
}

.calc-banner {
    background: linear-gradient(135deg, var(--mint-green) 0%, #064E3B 100%);
    color: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.calc-banner-content h2 { margin-bottom: 8px; color: white; }
.calc-banner-content p { color: rgba(255,255,255,0.8); }


/* =========================================
   FEATURES / TRUST SECTION
   ========================================= */
.trust-section {
    padding: 80px 5%;
    background: var(--card-bg);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-card {
    text-align: center;
    padding: 40px;
}

.trust-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-light);
    color: var(--royal-blue);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.trust-card:hover .trust-icon {
    background: var(--royal-blue);
    color: white;
    transform: scale(1.1);
}


.trust-card h3 {
    color: var(--text-heading);
    margin-bottom: 16px;
}

/* =========================================
   ROOMMATES PORTAL (Phase 9)
   ========================================= */
.rm-page-header {
    background: var(--card-bg);
    padding: 40px 5%;
    border-bottom: 1px solid var(--border-soft);
    text-align: center;
}

.rm-filters {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.rm-filters select, .rm-filters input {
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    font-family: var(--font-fam);
    font-size: 1rem;
    color: var(--navy-main);
    background: var(--bg-light);
    outline: none;
    min-width: 200px;
}
.rm-filters select:focus, .rm-filters input:focus {
    border-color: var(--royal-blue);
    background: var(--card-bg);
}

.rm-grid {
    padding: 40px 5%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.rm-view-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.rm-view-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(16, 185, 129, 0.3); /* Mint hint */
}

.rm-match-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--mint-green);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
}

.rm-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 16px auto 16px;
    border: 3px solid var(--bg-light);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.rm-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.rm-uni {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 500;
}

.rm-stats {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 24px;
}

.rm-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.rm-stat-value {
    font-weight: 800;
    color: var(--text-heading);
    font-size: 0.95rem;
}
.rm-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rm-connect-btn {
    width: 100%;
}
.rm-uni {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.rm-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}
.stat-item {
    text-align: center;
}
.stat-value {
    font-weight: 800;
    color: var(--navy-main);
    font-size: 1.1rem;
    display: block;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rm-reviews {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: left;
    margin-bottom: 24px;
}
.review-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.review-item:last-child {
    margin-bottom: 0;
}
.review-icon {
    color: var(--mint-green);
    flex-shrink: 0;
    margin-top: 2px;
}

/* =========================================
   LOGIN / REGISTER PAGE & QUESTIONNAIRE
   ========================================= */
.split-page {
    display: flex;
    flex-direction: row; /* FORCE SIDE BY SIDE */
    height: 100vh;
    width: 100vw;
    background: #f8fafc;
    overflow: hidden;
}

.split-left {
    flex: 0 0 50%; /* Fixed 50% width */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    background: var(--card-bg);
    overflow-y: auto; /* ALLOW SCROLL IF FORM IS LONG */
}

.split-right {
    flex: 0 0 50%; /* Fixed 50% width */
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--royal-blue) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: white;
    overflow: hidden;
}

.split-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
      radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.form-container {
    width: 100%;
    max-width: 450px;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 8px;
}
.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
    width: 100%; /* Ensure inputs take full container width */
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy-main);
    margin-bottom: 8px;
}
.input-field {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-heading);
    transition: all 0.2s ease;
    box-sizing: border-box; /* IMPORTANT to prevent overflow */
}
.input-field:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Questionnaire Styles */
.question-block {
    margin-bottom: 32px;
}
.question-block h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.option-card {
    display: block;
    cursor: pointer;
    position: relative;
    width: 100%;
}
.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}
.option-content {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}
.option-title {
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}
.option-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.option-card input[type="radio"]:checked + .option-content {
    border-color: var(--royal-blue);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 1px var(--royal-blue);
}

/* Auth Steps Logic */
.auth-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.auth-step.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.auth-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.progress-dot {
    height: 6px;
    flex: 1;
    background: var(--border-soft);
    border-radius: 3px;
    transition: background 0.3s;
}
.progress-dot.active {
    background: var(--royal-blue);
}

[data-theme="dark"] {
    --bg-light: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border-soft: #30363d;
    --text-heading: #e6edf3;
    --navy-main: #cbd5e1;
}

option { background: var(--card-bg); color: var(--text-heading); }
