/* ===== Freelance Rate Estimator — Site Styles ===== */
:root {
  --navy: #1A1A2E; --accent: #0F3460; --light: #F0F3FF; --white: #FFFFFF;
  --green: #16A34A; --green-bg: #ECFDF5; --orange: #EA580C; --orange-bg: #FFF7ED;
  --gray: #6B7280; --gray-light: #F5F6FA; --text: #1A1A1A; --text-light: #4B5563;
  --border: #E5E7EB; --radius: 8px; --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08); --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 1100px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); line-height: 1.6; background: var(--white); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header { background: var(--navy); color: var(--white); padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
header .logo { font-size: 1.25rem; font-weight: 700; color: var(--white); }
header .logo span { color: #60A5FA; }
header nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
header nav a { color: #CBD5E1; font-size: .875rem; }
header nav a:hover, header nav a.active { color: var(--white); text-decoration: none; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy), var(--accent)); color: var(--white); padding: 4rem 0; text-align: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: .75rem; }
.hero p { font-size: 1.125rem; color: #CBD5E1; max-width: 700px; margin: 0 auto 1.5rem; }

/* Buttons */
.btn { display: inline-block; padding: .75rem 1.5rem; border-radius: var(--radius); font-weight: 600; font-size: .9375rem; cursor: pointer; text-align: center; border: none; transition: all .2s; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: #15803D; text-decoration: none; }
.btn-secondary { background: var(--white); color: var(--accent); border: 2px solid var(--accent); }
.btn-secondary:hover { background: var(--light); text-decoration: none; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .75rem; color: var(--navy); }

/* Badges */
.badge { display: inline-block; padding: .25rem .625rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue { background: var(--light); color: var(--accent); }
.badge-gray { background: var(--gray-light); color: var(--gray); }
.tier-a { background: #ECFDF5; color: #065F46; }
.tier-b { background: #FEF3C7; color: #92400E; }
.tier-c { background: #FFF7ED; color: #C2410C; }
.tier-d { background: #EFF6FF; color: #1E40AF; }
.tier-e { background: #F3F4F6; color: #4B5563; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .375rem; color: var(--navy); font-size: .875rem; }
.form-group select, .form-group input { width: 100%; padding: .625rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .9375rem; font-family: var(--font); background: var(--white); }
.form-group select:focus, .form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,52,96,.15); }
.form-hint { font-size: .8125rem; color: var(--gray); margin-top: .25rem; }

/* Calculator */
.calculator-box { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 2rem; }
.calc-section { margin-bottom: 1.5rem; }
.calc-section h3 { font-size: .9375rem; color: var(--accent); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .calc-row { grid-template-columns: 1fr; } }

.results { background: var(--green-bg); border: 1.5px solid #BBF7D0; border-radius: var(--radius-lg); padding: 1.5rem; margin-top: 1.5rem; }
.results h3 { color: var(--green); margin-bottom: 1rem; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: .75rem 0; border-bottom: 1px solid #BBF7D0; }
.result-row:last-child { border-bottom: none; }
.result-label { font-weight: 600; color: var(--navy); }
.result-value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.result-hint { font-size: .8125rem; color: var(--gray); }

.confidence-indicator { margin-top: .75rem; padding: .5rem .75rem; border-radius: var(--radius); font-size: .8125rem; }

/* Assumptions */
.assumptions { background: var(--light); border-radius: var(--radius-lg); padding: 1.25rem; margin-top: 1.5rem; }
.assumptions h4 { color: var(--navy); margin-bottom: .75rem; font-size: .9375rem; }
.assumptions p { font-size: .8125rem; color: var(--text-light); margin-bottom: .25rem; }

/* Content */
.content { max-width: 800px; margin: 2rem auto; padding: 0 1.5rem; }
.content h1 { font-size: 2rem; color: var(--navy); margin-bottom: 1rem; }
.content h2 { font-size: 1.375rem; color: var(--navy); margin: 2rem 0 .75rem; }
.content h3 { font-size: 1.125rem; color: var(--navy); margin: 1.5rem 0 .5rem; }
.content p { margin-bottom: 1rem; color: var(--text-light); }
.content ul, .content ol { margin: 0 0 1rem 1.5rem; color: var(--text-light); }
.content li { margin-bottom: .375rem; }
.content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
@media (max-width: 640px) {
  .content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .content th, .content td { white-space: normal; max-width: 180px; }
}
.content th, .content td { padding: .625rem .75rem; border: 1px solid var(--border); text-align: left; font-size: .875rem; }
.content th { background: var(--navy); color: var(--white); font-weight: 600; }
.content tr:nth-child(even) { background: var(--gray-light); }
.content blockquote { border-left: 4px solid var(--accent); padding: .5rem 1rem; margin: 1rem 0; color: var(--text-light); font-style: italic; background: var(--light); border-radius: 0 var(--radius) var(--radius) 0; }

.teaser { background: var(--orange-bg); border: 1.5px solid #FED7AA; border-radius: var(--radius-lg); padding: 1.5rem; margin: 2rem 0; text-align: center; }
.teaser h3 { color: var(--orange); margin-bottom: .5rem; }
.teaser p { color: var(--text-light); margin-bottom: 1rem; }

/* Footer */
footer { background: var(--navy); color: #CBD5E1; padding: 2rem 0; margin-top: 4rem; text-align: center; font-size: .8125rem; }
footer a { color: #60A5FA; }
footer .footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Table scroll wrapper for mobile */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
.table-scroll table { min-width: 600px; }

/* Search */
.search-box { position: relative; margin-bottom: 1rem; }
.search-box input { width: 100%; padding: .625rem 1rem .625rem 2.5rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .9375rem; }
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray); }

/* Selector with search */
.skill-results { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-top: .25rem; display: none; }
.skill-results.active { display: block; }
.skill-item { padding: .625rem .75rem; cursor: pointer; border-bottom: 1px solid var(--border); font-size: .875rem; }
.skill-item:hover { background: var(--light); }
.skill-item.selected { background: var(--light); font-weight: 600; }
.skill-item .strength { float: right; font-size: .75rem; padding: .125rem .5rem; border-radius: 999px; }

/* Tabs */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.tab { padding: .625rem 1rem; cursor: pointer; font-weight: 600; font-size: .875rem; color: var(--gray); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* Skill category tags */
.category-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.cat-tag { padding: .375rem .75rem; border-radius: 999px; font-size: .8125rem; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--text-light); transition: all .15s; }
.cat-tag:hover, .cat-tag.active { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* Mobile nav */
.mobile-menu-btn { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }

/* Responsive breakpoints */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero { padding: 2.5rem 0; }
  .content { max-width: 100%; margin: 1.5rem auto; padding: 0 1rem; }
  .content h1 { font-size: 1.625rem; }
  .calculator-box { padding: 1.25rem; }
  .result-value { font-size: 1.25rem; }
  .container { padding: 0 1rem; }
  header .container { gap: .75rem; }
  .btn-lg { padding: .875rem 1.5rem; font-size: 1rem; width: 100%; max-width: 360px; }
}

@media (max-width: 640px) {
  header nav { display: none; width: 100%; flex-direction: column; gap: .5rem; padding-top: .5rem; }
  header nav.open { display: flex; }
  .mobile-menu-btn { display: block; }
  .hero h1 { font-size: 1.625rem; }
  .hero p { font-size: .9375rem; }
  .hero { padding: 2rem 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .footer-links { gap: .75rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.375rem; }
  .hero p { font-size: .875rem; }
  .hero { padding: 1.5rem 0; }
  .content h1 { font-size: 1.375rem; }
  .content h2 { font-size: 1.125rem; }
  .content h3 { font-size: 1rem; }
  .content { padding: 0 .75rem; }
  .calculator-box { padding: 1rem; }
  .calc-section h3 { font-size: .8125rem; }
  .result-row { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .result-value { font-size: 1.125rem; }
  .assumptions { padding: 1rem; }
  .results { padding: 1rem; }
  header .logo { font-size: 1.125rem; }
  .form-group select, .form-group input { 
    padding: .75rem .75rem; 
    font-size: 1rem; 
    min-height: 44px;
  }
  .btn { padding: .75rem 1.25rem; font-size: .9375rem; min-height: 44px; }
  .cat-tag { padding: .5rem .75rem; font-size: .8125rem; }
  .skill-item { padding: .75rem; font-size: .875rem; }
  .tabs { overflow-x: auto; white-space: nowrap; }
  .tab { padding: .5rem .75rem; font-size: .8125rem; }
  footer { padding: 1.5rem 0; margin-top: 2rem; }
  .card { padding: 1rem; }
  .content th, .content td { padding: .5rem .5rem; font-size: .75rem; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 1.25rem; }
  .container { padding: 0 .625rem; }
  .content { padding: 0 .5rem; }
  .calculator-box { padding: .75rem; }
}

/* Tooltip */
.tooltip { position: relative; cursor: help; border-bottom: 1px dotted var(--gray); }
.tooltip::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--white); padding: .375rem .625rem; border-radius: var(--radius); font-size: .75rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.tooltip:hover::after { opacity: 1; }

/* Gate 5 content page classes */
.hero-guide, .hero-skill, .hero-country { background: linear-gradient(135deg, var(--navy), var(--accent)); color: var(--white); padding: 2rem; border-radius: var(--radius-lg); margin-bottom: 1.5rem; text-align: center; }
.hero-guide h1, .hero-skill h1, .hero-country h1 { color: var(--white); margin-bottom: .5rem; }
.lede, .subtitle { font-size: 1.125rem; color: var(--text-light); max-width: 700px; margin: 0 auto; }
.tier-badge { font-size: .8125rem; }
.cta-block { text-align: center; margin: 2rem 0; padding: 1.5rem; background: var(--light); border-radius: var(--radius-lg); }
.bls-card { background: var(--light); border-left: 4px solid var(--accent); padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1rem 0; }
.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
@media (max-width: 768px) { .tips-grid { grid-template-columns: 1fr; } }
.tip-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.tip-card h3 { margin-top: 0; color: var(--navy); }
.table-disclaimer { font-size: .75rem; color: var(--gray); margin-top: .5rem; }
.model-estimate { background: var(--orange-bg); border-left: 4px solid var(--orange); padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1rem 0; }
.model-flag { font-weight: 600; }
.related-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.related-links a { padding: .5rem 1rem; background: var(--light); border-radius: var(--radius); font-size: .875rem; }
.confidence-row { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
