/* =========================================
   agency.css — Shared Base Stylesheet
   ใช้ร่วมในทุกหน้า (login, buy, positions, agencies, exam)
   ========================================= */

:root {
  /* Blue scale */
  --blue-50:  #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;

  /* Navy (dark blue accent) */
  --navy-700: #1E40AF;
  --navy-800: #15306F;
  --navy-900: #1E3A8A;

  /* Gray scale */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Accents */
  --green-100: #D1FAE5;
  --green-500: #10B981;
  --green-600: #059669;
  --red-100:   #FEE2E2;
  --red-500:   #EF4444;
  --orange-500:#F97316;
  --orange-600:#EA580C;

  /* Pastel kawaii */
  --pastel-pink:   #FFD6E8;
  --pastel-yellow: #FFF3B0;
  --pastel-mint:   #C8F2E0;
  --pastel-blue:   #CDE7FF;
  --pastel-purple: #E6D7FF;

  /* Radius & shadow */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 28px rgba(30,58,138,.12);

  /* Typography */
  --font-heading: 'Prompt', 'Kanit', system-ui, -apple-system, sans-serif;
  --font-body:    'Prompt', 'Kanit', system-ui, -apple-system, sans-serif;
}

/* =========================================
   Reset & Base
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--navy-700); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.3;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

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

/* =========================================
   Container
   ========================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================================
   Navbar
   ========================================= */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy-900);
}
.brand:hover { color: var(--navy-900); }

.brand-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue-600), var(--navy-700));
  color: white;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-weight: 500;
  font-size: .95rem;
  transition: all .15s;
}
.nav-links a:hover { background: var(--blue-50); color: var(--navy-700); }
.nav-links a.active { background: var(--blue-100); color: var(--navy-900); font-weight: 600; }

.nav-cta {
  background: var(--orange-500) !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--orange-600) !important; color: white !important; }

.nav-toggle {
  display: none;
  background: transparent;
  font-size: 1.5rem;
  color: var(--navy-900);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: var(--gray-100); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 12px 14px; }
}

/* =========================================
   Buttons (shared)
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  transition: all .15s;
  border: 2px solid transparent;
  background: var(--gray-100);
  color: var(--gray-800);
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary { background: var(--blue-600); color: white; }
.btn-primary:hover { background: var(--navy-700); color: white; }
.btn-success { background: var(--green-500); color: white; }
.btn-success:hover { background: var(--green-600); color: white; }
.btn-orange  { background: var(--orange-500); color: white; }
.btn-orange:hover { background: var(--orange-600); color: white; }
.btn-outline { background: transparent; border-color: var(--blue-600); color: var(--blue-600); }
.btn-outline:hover { background: var(--blue-600); color: white; }
.btn-ghost   { background: transparent; color: var(--gray-700); }
.btn-ghost:hover   { background: var(--gray-100); }
.btn-sm      { padding: 8px 16px; font-size: .9rem; }
.btn-lg      { padding: 16px 32px; font-size: 1.1rem; }

/* =========================================
   Badge
   ========================================= */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.5;
}
.badge.green  { background: var(--green-100); color: var(--green-600); }
.badge.blue   { background: var(--blue-100);  color: var(--blue-600);  }
.badge.orange { background: #FED7AA;          color: var(--orange-600);}
.badge.gray   { background: var(--gray-100);  color: var(--gray-700);  }
.badge.red    { background: var(--red-100);   color: #B91C1C;          }

/* =========================================
   Footer (shared) — .footer และ .site-footer ใช้แทนกันได้
   ========================================= */
.footer,
.site-footer {
  background: var(--navy-900);
  color: #CBD5E1;
  padding: 40px 0 20px;
  margin-top: 60px;
}
.footer .container,
.site-footer .container {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
}
/* ถ้า footer มีแค่ footer-bottom อย่างเดียว (เช่นใน buy.html) ยังใช้ได้ */
.footer:not(:has(h4)) .container,
.footer .container:has(> .footer-bottom:only-child) {
  display: block;
}
.footer h4, .site-footer h4 { color: white; font-size: 1rem; margin-bottom: 14px; }
.footer ul, .site-footer ul { list-style: none; }
.footer ul li, .site-footer ul li { margin-bottom: 8px; font-size: .9rem; }
.footer a, .site-footer a { color: #CBD5E1; }
.footer a:hover, .site-footer a:hover { color: white; }
.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  text-align: center;
  font-size: .85rem;
  color: #94A3B8;
  grid-column: 1 / -1;
}
@media (max-width: 768px) {
  .footer .container, .site-footer .container { grid-template-columns: 1fr; gap: 24px; }
}

/* =========================================
   Utility
   ========================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

.fade-in {
  animation: fadeIn .5s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
