/* ========================================
   Landing, Login & Shared Styles
   ======================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #059669;
    --accent-light: #d1fae5;
    --text: #1e293b;
    --text-muted: #64748b;
    --bg: #ffffff;
    --bg-dark: #0f172a;
    --bg-accent: #1e3a5f;
    --border: #e2e8f0;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); }

/* Language Switcher */
.lang-switcher { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.lang-btn { padding: 6px 12px; border: none; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text); transition: all 0.2s; }
.lang-btn.active { background: var(--primary); color: #fff; }
.lang-btn:hover:not(.active) { background: var(--primary-light); }

/* =====================
   LANDING PAGE
   ===================== */

/* Navigation */
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 16px 0; transition: all 0.3s; }
.landing-nav.scrolled { background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 32px; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 18px; font-weight: 700; color: #fff; }
.landing-nav.scrolled .nav-logo { color: var(--text); }
.nav-logo i { font-size: 22px; color: var(--primary); }
.nav-links-landing { display: flex; gap: 24px; flex: 1; justify-content: center; }
.nav-links-landing a { text-decoration: none; color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.landing-nav.scrolled .nav-links-landing a { color: var(--text); }
.nav-links-landing a:hover { color: #fff; }
.landing-nav.scrolled .nav-links-landing a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-login-btn { padding: 8px 20px; background: var(--primary); color: #fff; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 500; transition: background 0.2s; }
.nav-login-btn:hover { background: var(--primary-dark); }
.landing-nav .lang-switcher { border-color: rgba(255,255,255,0.3); }
.landing-nav .lang-btn { color: rgba(255,255,255,0.7); }
.landing-nav .lang-btn.active { background: var(--primary); color: #fff; }
.landing-nav.scrolled .lang-switcher { border-color: var(--border); }
.landing-nav.scrolled .lang-btn { color: var(--text-muted); }
.mobile-toggle { display: none; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.landing-nav.scrolled .mobile-toggle { color: var(--text); }

@media (max-width: 768px) {
    .nav-links-landing { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    .nav-links-landing.open { display: flex; }
    .nav-links-landing a { color: var(--text) !important; padding: 8px 0; }
    .mobile-toggle { display: block; }
}

/* Hero */
.hero { min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 100px 24px 60px; }
.hero-bg { position: absolute; inset: 0; opacity: 0.08; }
.hero-grid { width: 100%; height: 100%; background-image: linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px); background-size: 60px 60px; }
.hero-content { position: relative; text-align: center; max-width: 900px; color: #fff; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px; background: rgba(37,99,235,0.2); border: 1px solid rgba(37,99,235,0.3); border-radius: 24px; font-size: 13px; font-weight: 500; margin-bottom: 24px; color: #93c5fd; }
.hero-content h1 { font-size: 48px; font-weight: 800; line-height: 1.15; margin-bottom: 20px; background: linear-gradient(to right, #fff, #93c5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 18px; line-height: 1.6; color: #94a3b8; max-width: 700px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 48px; }
.btn-hero { padding: 14px 28px; border-radius: 8px; text-decoration: none; font-size: 15px; font-weight: 600; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-hero.primary { background: var(--primary); color: #fff; }
.btn-hero.primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-hero.secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-hero.secondary:hover { background: rgba(255,255,255,0.15); }
.hero-stats { display: flex; justify-content: center; gap: 0; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px 0; }
.hero-stat { flex: 1; text-align: center; padding: 0 24px; }
.hero-stat-value { display: block; font-size: 22px; font-weight: 700; color: #fff; }
.hero-stat-label { display: block; font-size: 12px; color: #64748b; margin-top: 4px; }
.hero-stat-divider { width: 1px; background: rgba(255,255,255,0.1); }

@media (max-width: 768px) {
    .hero-content h1 { font-size: 32px; }
    .hero-stats { flex-wrap: wrap; }
    .hero-stat { min-width: 45%; padding: 12px; }
    .hero-stat-divider { display: none; }
}

/* Sections */
.section { padding: 80px 24px; }
.section-dark { background: var(--bg-dark); color: #fff; }
.section-accent { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); color: #fff; }
.container { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.section-header p { font-size: 16px; color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.section-header.light p { color: #94a3b8; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 28px; transition: all 0.3s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: #fff; font-size: 20px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr; } }

/* Technology */
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 48px; }
.tech-category h4 { font-size: 14px; color: #94a3b8; margin-bottom: 12px; }
.tech-items { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-badge { padding: 6px 14px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; font-size: 13px; color: #cbd5e1; }
.tech-badge.highlight { background: rgba(37,99,235,0.2); border-color: rgba(37,99,235,0.3); color: #93c5fd; }
@media (max-width: 768px) { .tech-grid { grid-template-columns: 1fr 1fr; } }

/* Architecture Flow */
.arch-flow { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; padding: 24px 0; }
.arch-node { padding: 16px 20px; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 600; min-width: 120px; }
.arch-node small { display: block; font-size: 11px; font-weight: 400; opacity: 0.7; margin-top: 4px; }
.arch-node.input { background: rgba(37,99,235,0.2); border: 1px solid rgba(37,99,235,0.3); color: #93c5fd; }
.arch-node.process { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #cbd5e1; }
.arch-node.ml { background: rgba(5,150,105,0.2); border: 1px solid rgba(5,150,105,0.3); color: #6ee7b7; }
.arch-node.output { background: rgba(217,119,6,0.2); border: 1px solid rgba(217,119,6,0.3); color: #fcd34d; }
.arch-arrow { padding: 0 12px; color: rgba(255,255,255,0.3); font-size: 16px; }

/* Data Source Cards */
.data-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.data-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: all 0.3s; }
.data-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }
.data-card-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.data-card-header.gfs { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.data-card-header.era5 { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.data-card-header.srtm { background: linear-gradient(135deg, #059669, #047857); }
.data-card-header i { font-size: 28px; opacity: 0.6; }
.data-badge { padding: 4px 12px; background: rgba(255,255,255,0.2); border-radius: 12px; font-size: 12px; font-weight: 500; }
.data-card h3 { padding: 16px 20px 0; font-size: 18px; }
.data-card p { padding: 8px 20px; font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.data-meta { padding: 12px 20px 16px; display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }
.data-meta span { display: flex; align-items: center; gap: 4px; }
.data-meta i { color: var(--primary); }
@media (max-width: 900px) { .data-cards { grid-template-columns: 1fr; } }

/* Results */
.results-highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.result-highlight { text-align: center; padding: 24px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; }
.result-value { font-size: 40px; font-weight: 800; color: #6ee7b7; }
.result-label { font-size: 13px; color: #94a3b8; margin-top: 4px; }
@media (max-width: 768px) { .results-highlights { grid-template-columns: 1fr 1fr; } }

.results-table-wrapper { overflow-x: auto; margin-bottom: 32px; }
.results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.results-table th { padding: 12px 16px; text-align: left; color: #94a3b8; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 500; }
.results-table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #cbd5e1; }
.results-table tr.best td { color: #6ee7b7; }
.results-table tr:hover td { background: rgba(255,255,255,0.03); }
.results-cta { text-align: center; margin-top: 32px; }

/* Footer */
.landing-footer { background: #0a0f1c; color: #94a3b8; padding: 60px 24px 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.footer-logo i { color: var(--primary); font-size: 22px; }
.footer-brand p { font-size: 14px; line-height: 1.6; max-width: 350px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4 { color: #fff; font-size: 14px; margin-bottom: 4px; }
.footer-links a { color: #64748b; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; display: flex; justify-content: space-between; font-size: 13px; }
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; }
}

/* =====================
   LOGIN PAGE
   ===================== */

.login-body { background: #f1f5f9; min-height: 100vh; }
.login-topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; background: #fff; border-bottom: 1px solid var(--border); }
.login-topbar .nav-logo { color: var(--text); }
.login-topbar .lang-switcher { border-color: var(--border); }

.login-wrapper { display: flex; min-height: calc(100vh - 65px); }
.login-left { flex: 1; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }

@media (max-width: 900px) {
    .login-wrapper { flex-direction: column; }
    .login-left { min-height: 200px; }
    .login-right { padding: 24px 16px; }
    .login-card h1 { font-size: 20px; }
}

/* =====================
   MOBILE RESPONSIVE
   ===================== */

@media (max-width: 768px) {
    /* Landing Hero */
    .hero { padding-top: 80px; min-height: auto; }
    .hero-content h1 { font-size: 26px; }
    .hero-content p { font-size: 14px; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons a { width: 100%; text-align: center; }
    .hero-stats { flex-direction: column; padding: 16px; gap: 12px; }
    .hero-stat { min-width: 100%; }
    .hero-stat-divider { display: none; }

    /* Sections */
    .section { padding: 40px 16px; }
    .section-header h2 { font-size: 24px; }
    .section-header p { font-size: 14px; }

    /* Features */
    .features-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { padding: 20px; }

    /* Tech grid */
    .tech-grid { grid-template-columns: 1fr; gap: 16px; }

    /* Architecture flow */
    .arch-flow { flex-direction: column; gap: 0; }
    .arch-node { min-width: 80%; }
    .arch-arrow { transform: rotate(90deg); padding: 8px 0; }

    /* Data cards */
    .data-cards { grid-template-columns: 1fr; }

    /* Results */
    .results-highlights { grid-template-columns: 1fr 1fr; gap: 8px; }
    .result-highlight { padding: 16px; }
    .result-value { font-size: 28px; }
    .results-table { font-size: 12px; }
    .results-table th, .results-table td { padding: 8px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 6px; }

    /* Nav */
    .nav-container { padding: 0 12px; gap: 12px; }
    .nav-logo { font-size: 15px; }
    .nav-logo i { font-size: 18px; }
    .nav-login-btn { padding: 6px 14px; font-size: 13px; }

    /* Login page */
    .login-topbar { padding: 12px 16px; }
    .login-overlay h2 { font-size: 20px; }
    .login-big-icon { font-size: 40px; }
    .login-overlay p { font-size: 16px; }
    .login-features { font-size: 12px; }
    .login-left { min-height: 160px; }
    .login-right { padding: 20px 16px; }
    .login-card h1 { font-size: 20px; margin-bottom: 20px; }
    .btn-login { padding: 11px; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 22px; }
    .results-highlights { grid-template-columns: 1fr; }
    .login-left { display: none; }
    .login-right { min-height: 100vh; }
    .tech-items { gap: 4px; }
    .tech-badge { padding: 4px 10px; font-size: 12px; }
}

/* Login illustration */
.login-illustration { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.login-map-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 20px; opacity: 0.4; }
.grid-cell { border-radius: 4px; animation: gridPulse 4s ease-in-out infinite; }
.c1 { background: #1e40af; animation-delay: 0s; }
.c2 { background: #2563eb; animation-delay: 0.3s; }
.c3 { background: #3b82f6; animation-delay: 0.6s; }
.c4 { background: #60a5fa; animation-delay: 0.9s; }
.c5 { background: #93c5fd; animation-delay: 1.2s; }
.c6 { background: #fbbf24; animation-delay: 1.5s; }
.c7 { background: #f59e0b; animation-delay: 1.8s; }
.c8 { background: #ef4444; animation-delay: 2.1s; }
@keyframes gridPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }

.login-overlay { position: relative; text-align: center; color: #fff; padding: 40px; }
.login-big-icon { font-size: 64px; color: #60a5fa; margin-bottom: 16px; }
.login-overlay h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.login-overlay p { font-size: 20px; color: #94a3b8; margin-bottom: 24px; }
.login-overlay p i { margin: 0 8px; font-size: 14px; color: #60a5fa; }
.login-features { display: flex; flex-direction: column; gap: 10px; text-align: left; font-size: 14px; color: #cbd5e1; }
.login-features i { color: #6ee7b7; margin-right: 8px; }

/* Login Card */
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 28px; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.input-icon-wrapper { position: relative; }
.input-icon-wrapper i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }
.input-icon-wrapper input { width: 100%; padding: 12px 12px 12px 42px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: border-color 0.2s; background: #fff; }
.input-icon-wrapper input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-light); }

.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; color: var(--text-muted); }
.forgot-link { font-size: 14px; color: var(--primary); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

.btn-login { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-login:hover { background: var(--primary-dark); }

.login-divider { text-align: center; margin: 24px 0; color: var(--text-muted); font-size: 13px; position: relative; }
.login-divider::before, .login-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

.btn-demo { width: 100%; padding: 14px 20px; background: var(--accent-light); color: var(--accent); border: 1px solid rgba(5,150,105,0.2); border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left; transition: all 0.2s; font-size: 14px; }
.btn-demo:hover { background: #a7f3d0; }
.btn-demo i { font-size: 22px; }
.btn-demo strong { display: block; }
.btn-demo small { color: var(--text-muted); font-size: 12px; }

.login-footer-text { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.login-footer-text a { color: var(--primary); text-decoration: none; font-weight: 500; }
.login-footer-text a:hover { text-decoration: underline; }
