/* ============================================
   CasaAgentMatch - Global Styles
   Shared components for all pages
   ============================================ */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --primary: #006D4F;
    --primary-light: #00A571;
    --primary-dark: #005540;
    
    /* Secondary Colors */
    --secondary: #FF6B35;
    --secondary-light: #FF8A5B;
    --secondary-dark: #E55520;
    
    /* Accent Color */
    --accent: #00D9FF;
    --accent-light: #5EEAFF;
    --accent-dark: #00B8D9;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --light: #F8F9FA;
    --gray-50: #F8F9FA;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --dark: #0F172A;
    
    /* Text Colors */
    --text: #1A1A1A;
    --text-light: #666666;
    --text-muted: #94A3B8;
    
    /* Border */
    --border: #E5E7EB;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Typography */
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-light);
    line-height: 1.7;
}

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

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
}

/* ===== GLOBAL NAVBAR ===== */
.global-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: var(--transition-base);
    border-bottom: 1px solid transparent;
}

.global-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border);
}

.global-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.navbar-logo img {
    height: 40px;
    width: auto;
}

.navbar-logo .logo-highlight {
    color: var(--secondary);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar-nav a {
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding: 8px 0;
}

.navbar-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.navbar-nav a:hover::after {
    width: 100%;
}

.navbar-nav a:hover {
    color: var(--primary);
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition-base);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    padding: 20px;
    z-index: 999;
    overflow-y: auto;
}

.mobile-nav.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav a {
    display: block;
    padding: 16px 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.mobile-nav a:hover {
    color: var(--primary);
}

.mobile-nav .btn {
    width: 100%;
    margin-top: 16px;
    justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 109, 79, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 109, 79, 0.4);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

.btn-white {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.btn-white:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* Button Ripple Effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    color: var(--text);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 109, 79, 0.1);
}

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

.form-input.error {
    border-color: #EF4444;
}

.form-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 6px;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-checkbox span {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

.form-checkbox a {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* ===== AUTH LAYOUT ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.auth-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1000px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.auth-visual {
    background: var(--gradient-primary);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.auth-visual h2 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.auth-visual p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.auth-visual-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.auth-form {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-form .subtitle {
    color: var(--text-light);
    margin-bottom: 32px;
}

.auth-form .btn {
    margin-top: 8px;
}

.auth-links {
    margin-top: 24px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-links a {
    color: var(--primary);
    font-weight: 600;
}

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

/* ===== GLOBAL FOOTER ===== */
.global-footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 16px;
    line-height: 1.7;
    max-width: 300px;
}

.footer-column h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 20px;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-base);
}

.footer-column a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.footer-bottom-links a:hover {
    color: var(--white);
}

/* ===== LANGUAGE SELECTOR ===== */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-base);
}

.lang-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 150px;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid var(--border);
}

.lang-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.lang-item:hover {
    background: var(--gray-50);
}

.lang-item.active {
    background: rgba(0, 109, 79, 0.1);
    color: var(--primary);
    font-weight: 600;
}

/* ===== ALERTS & MESSAGES ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 1024px) {
    .navbar-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .navbar-actions {
        gap: 12px;
    }
    
    .navbar-actions .btn-outline {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .global-navbar {
        height: 60px;
    }
    
    .navbar-logo {
        font-size: 1.1rem;
    }
    
    .navbar-logo img {
        height: 32px;
    }
    
    .mobile-nav {
        top: 60px;
    }
    
    /* Auth Layout Mobile */
    .auth-container {
        padding: 80px 16px 30px;
    }
    
    .auth-box {
        grid-template-columns: 1fr;
    }
    
    .auth-visual {
        display: none;
    }
    
    .auth-form {
        padding: 40px 24px;
    }
    
    .auth-form h1 {
        font-size: 1.5rem;
    }
    
    /* Footer Mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-brand p {
        max-width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-form {
        padding: 30px 20px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .navbar-actions .btn-primary {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ===== PAGE CONTENT SPACING ===== */
.page-content {
    padding-top: 70px;
}

@media (max-width: 768px) {
    .page-content {
        padding-top: 60px;
    }
}
