/* ============================================
   MaxJobs – Premium Job Portal CSS
   Optimized for Google AdX (max impressions)
   Mobile-first, responsive, modern UI
   ============================================ */

:root {
  --primary: #0a4d8c;
  --primary-dark: #073968;
  --accent: #ffb800;
  --accent-2: #00c896;
  --text: #1a1a2e;
  --muted: #6b7280;
  --bg: #f6f9fc;
  --card: #ffffff;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(10,77,140,.06), 0 1px 3px rgba(10,77,140,.05);
  --shadow-md: 0 4px 12px rgba(10,77,140,.08), 0 2px 6px rgba(10,77,140,.05);
  --shadow-lg: 0 12px 32px rgba(10,77,140,.12), 0 6px 16px rgba(10,77,140,.08);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ============== Top Bar ============== */
.topbar {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  font-size: 12px;
  padding: 6px 0;
  text-align: center;
}
.topbar span { opacity: .9; }

/* ============== Header ============== */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: -.4px;
}
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 18px;
  box-shadow: 0 2px 8px rgba(10,77,140,.25);
}
.logo small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .3px; }

.nav { display: flex; gap: 18px; }
.nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: .2s;
}
.nav a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.nav a.active { color: var(--primary); border-color: var(--accent); }

.menu-btn {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 36px; height: 36px;
  color: var(--text);
}

/* ============== Hero / Step Header ============== */
.step-hero {
  background:
    radial-gradient(1200px 400px at 20% -10%, rgba(255,184,0,.15), transparent 60%),
    radial-gradient(800px 300px at 90% 0%, rgba(0,200,150,.18), transparent 60%),
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 36px 18px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.step-hero::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M20 0v40M0 20h40' stroke='rgba(255,255,255,.04)' stroke-width='1'/%3E%3C/svg%3E");
  opacity: .4; pointer-events: none;
}
.crumbs {
  font-size: 12px; opacity: .85; margin-bottom: 8px; position: relative;
}
.crumbs a { color: #fff; opacity: .9; }
.crumbs .sep { margin: 0 6px; opacity: .6; }

.step-hero h1 {
  font-size: 26px; line-height: 1.25; font-weight: 800;
  margin-bottom: 8px; position: relative; letter-spacing: -.5px;
}
.step-hero p {
  font-size: 15px; opacity: .92; max-width: 640px; margin: 0 auto; position: relative;
}
.flag {
  display: inline-block; font-size: 28px; margin-bottom: 6px; position: relative;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

/* ============== Progress ============== */
.progress {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
}
.progress-inner {
  max-width: 800px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px;
}
.progress-step {
  flex: 1; height: 6px; background: var(--border); border-radius: 4px;
  position: relative; overflow: hidden;
}
.progress-step.done { background: var(--success); }
.progress-step.active {
  background: linear-gradient(90deg, var(--accent-2) var(--p, 0%), var(--border) var(--p, 0%));
}
.progress-labels {
  max-width: 800px; margin: 6px auto 0;
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); font-weight: 500;
}
.progress-labels .done { color: var(--success); }
.progress-labels .active { color: var(--primary); font-weight: 700; }

/* ============== Main container ============== */
.container {
  max-width: 800px; margin: 0 auto; padding: 22px 18px 100px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  animation: slideUp .4s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.card h2 {
  font-size: 19px; margin-bottom: 6px; color: var(--text); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card h2 .num {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  color: #fff; display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(10,77,140,.2);
}
.card .desc { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* ============== Option grid ============== */
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.option {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.option:hover {
  border-color: var(--primary);
  background: #f0f7ff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.option.selected {
  border-color: var(--accent-2);
  background: linear-gradient(135deg, rgba(0,200,150,.08), rgba(10,77,140,.05));
  box-shadow: 0 4px 14px rgba(0,200,150,.2);
}
.option .ico {
  font-size: 24px; width: 44px; height: 44px;
  background: #f3f4f6; border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: .2s;
}
.option:hover .ico { background: #fff; }
.option.selected .ico { background: linear-gradient(135deg, var(--primary), var(--accent-2)); color: #fff; }
.option .label { font-weight: 600; font-size: 14px; line-height: 1.3; }
.option .sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* ============== Buttons ============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: 0; border-radius: 10px;
  font: inherit; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(10,77,140,.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10,77,140,.4);
  text-decoration: none;
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #ff9500);
  color: #1a1a2e;
  box-shadow: 0 4px 14px rgba(255,184,0,.35);
}
.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,184,0,.5);
  text-decoration: none;
}
.btn-ghost {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: #f3f4f6; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-row {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
.btn-row .btn { flex: 1; min-width: 140px; }

/* ============== Auto-advance timer ============== */
.timer {
  margin-top: 14px; padding: 10px 14px;
  background: #fff8e6; border: 1px solid #fde68a;
  border-radius: 8px; font-size: 13px; color: #92400e;
  display: flex; align-items: center; gap: 10px;
}
.timer.hide { display: none; }
.timer .spin {
  width: 14px; height: 14px; border: 2px solid #f59e0b;
  border-top-color: transparent; border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== Ad slots ============== */
.ad-slot {
  margin: 16px auto;
  text-align: center;
  background: linear-gradient(135deg, #fafbfc, #f1f3f6);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 6px;
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute; top: 4px; left: 8px;
  font-size: 9px; color: #94a3b8; letter-spacing: .5px;
  text-transform: uppercase; font-weight: 600;
}
.ad-slot.top { min-height: 100px; }
.ad-slot.middle { min-height: 280px; }
.ad-slot.sticky { min-height: 60px; }

.ad-sticky-wrap {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 6px;
  box-shadow: 0 -4px 14px rgba(0,0,0,.08);
  display: flex; justify-content: center; align-items: center;
  transform: translateY(0); transition: transform .3s;
}
.ad-sticky-wrap.hidden { transform: translateY(100%); }
.ad-sticky-wrap .close {
  position: absolute; top: 4px; right: 8px;
  background: #000; color: #fff; border: 0;
  width: 22px; height: 22px; border-radius: 50%;
  cursor: pointer; font-size: 12px; line-height: 1;
  opacity: .6;
}
.ad-sticky-wrap .close:hover { opacity: 1; }

/* ============== Results / Job cards ============== */
.job-list { display: grid; gap: 12px; }
.job-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  transition: .2s;
  cursor: pointer;
  position: relative;
}
.job-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.job-card .company-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 18px;
  flex-shrink: 0;
}
.job-card .info { flex: 1; min-width: 0; }
.job-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.job-card .meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: var(--muted);
}
.job-card .meta span { display: inline-flex; align-items: center; gap: 3px; }
.job-card .salary { color: var(--success); font-weight: 700; font-size: 13px; }
.job-card .apply {
  background: var(--success); color: #fff;
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  font-weight: 700;
}
.badge {
  position: absolute; top: 12px; right: 12px;
  background: #fef3c7; color: #92400e;
  padding: 3px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
}
.badge.hot { background: #fee2e2; color: #b91c1c; }
.badge.new { background: #d1fae5; color: #065f46; }

/* ============== Country selector ============== */
.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}
.country-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: .25s;
  text-decoration: none;
  color: var(--text);
  display: block;
  position: relative;
  overflow: hidden;
}
.country-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,77,140,.04), rgba(0,200,150,.04));
  opacity: 0; transition: .25s;
}
.country-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.country-card:hover::before { opacity: 1; }
.country-card .flag-big { font-size: 56px; margin-bottom: 10px; position: relative; }
.country-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; position: relative; }
.country-card p { font-size: 13px; color: var(--muted); position: relative; }
.country-card .jobs-count {
  display: inline-block; margin-top: 12px;
  background: var(--accent); color: #1a1a2e;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700; position: relative;
}

/* ============== Keyword list ============== */
.kw-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.kw-grid a {
  font-size: 12px; padding: 8px 10px;
  background: #f3f4f6; border-radius: 6px;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: .2s;
}
.kw-grid a:hover { background: var(--primary); color: #fff; text-decoration: none; }
.kw-grid a::before { content: "💼"; font-size: 10px; }

/* ============== Stats strip ============== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  margin-bottom: 18px;
}
.stat { text-align: center; }
.stat .n { font-size: 18px; font-weight: 800; color: var(--primary); }
.stat .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }

/* ============== Footer ============== */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 30px 18px 80px;
  text-align: center;
  font-size: 12px;
}
.footer a { color: #cbd5e1; margin: 0 8px; }
.footer a:hover { color: #fff; }
.footer .legal { margin: 12px 0 6px; }
.footer .copy { opacity: .6; margin-top: 8px; }

/* ============== Search box ============== */
.search-box {
  display: flex; gap: 0;
  max-width: 600px; margin: 16px auto 0;
  background: #fff; border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow-md);
  position: relative;
}
.search-box input {
  flex: 1; padding: 14px 16px;
  border: 0; outline: 0; font: inherit; font-size: 14px;
}
.search-box button {
  padding: 0 22px; border: 0;
  background: linear-gradient(135deg, var(--accent), #ff9500);
  color: #1a1a2e; font-weight: 700; cursor: pointer; font-size: 14px;
}

/* ============== Toast ============== */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-100px);
  background: #1a1a2e; color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  z-index: 300; transition: .3s;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============== Responsive ============== */
@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--border);
    padding: 10px 18px; box-shadow: var(--shadow-md);
  }
  .menu-btn { display: grid; place-items: center; }
  .step-hero h1 { font-size: 22px; }
  .step-hero p { font-size: 14px; }
  .options { grid-template-columns: 1fr; }
  .country-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .job-card { flex-wrap: wrap; }
  .job-card .apply { width: 100%; text-align: center; }
  .kw-grid { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .container { max-width: 960px; }
  .options { grid-template-columns: repeat(3, 1fr); }
  .country-grid { grid-template-columns: repeat(2, 1fr); }
}
