/* ============================================================
   MEPCO Bill Online — Main CSS
   Mobile-first, light theme, no CDN
   ============================================================ */

/* Local Fonts */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* Reset */
*, *::before, *::after { 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', Arial, sans-serif;
  font-size: 16px; line-height: 1.6;
  color: #1a1a1a; background: #f8f9fb;
  min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #1a6b3a; text-decoration: none; transition: color .15s; }
a:hover { color: #0a4d2b; text-decoration: underline; }
ul, ol { list-style: none; }

/* Variables */
:root {
  --primary: #1a6b3a;
  --primary-dark: #0a4d2b;
  --accent: #28a745;
  --danger: #c0392b;
  --gray-50: #f8f9fb;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-500: #6c757d;
  --gray-700: #495057;
  --gray-900: #1a1a1a;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.12);
}

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; width: 100%; }

main { flex: 1; padding: 20px 0 40px; }

/* ──────────────────────────────────────────────────────────
   HEADER
   ────────────────────────────────────────────────────────── */
.site-header {
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--gray-200);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; color: var(--primary);
}
.brand:hover { color: var(--primary-dark); text-decoration: none; }
.brand-icon { font-size: 1.4rem; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-links a {
  color: var(--gray-700); padding: 8px 14px; border-radius: 6px;
  font-size: .92rem; font-weight: 500;
}
.nav-links a:hover { background: var(--gray-100); color: var(--primary); text-decoration: none; }
.nav-links a.active { background: var(--primary); color: #fff; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--gray-700);
  border-radius: 2px; transition: .25s;
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0;
    background: #fff; flex-direction: column; gap: 0;
    padding: 8px; box-shadow: var(--shadow);
    transform: translateY(-150%);
    transition: transform .25s;
    pointer-events: none;
    border-bottom: 1px solid var(--gray-200);
  }
  .nav-links.open { transform: translateY(0); pointer-events: auto; }
  .nav-links a { width: 100%; padding: 11px 16px; border-radius: 0; }
}

/* ──────────────────────────────────────────────────────────
   HOME HERO + FORM
   ────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; padding: 40px 24px; border-radius: var(--radius-lg);
  text-align: center; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 10px; line-height: 1.3; }
.hero p { opacity: .92; font-size: 1rem; max-width: 540px; margin: 0 auto; }

.bill-form-card {
  background: #fff; padding: 28px 24px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 28px; max-width: 560px;
  margin-left: auto; margin-right: auto; width: 100%;
}
@media (max-width: 600px) {
  .bill-form-card { padding: 22px 18px; }
}
.bill-form-title {
  text-align: center; font-size: 1.4rem; margin-bottom: 18px;
  color: var(--gray-900);
}
.bill-input {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  font-size: 1rem; font-family: inherit; letter-spacing: 1px;
  margin-bottom: 12px; transition: border .2s;
  background: var(--gray-50); text-align: center;
}
.bill-input:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(26,107,58,.1);
}
.bill-input::placeholder { color: var(--gray-500); font-weight: 400; letter-spacing: .5px; }

.bill-or-text {
  text-align: center; font-size: .92rem; color: var(--gray-500);
  margin: 6px 0; font-weight: 600;
}

.bill-save-box {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0;
}
.bill-checkbox {
  width: 18px; height: 18px; cursor: pointer; margin: 0;
  accent-color: var(--primary);
}
.bill-label {
  font-size: .9rem; color: var(--gray-700); cursor: pointer; user-select: none;
}

.bill-btn {
  width: 100%; padding: 14px 24px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); font-size: 1.05rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: .15s;
  box-shadow: 0 4px 14px rgba(26,107,58,.25);
}
.bill-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,107,58,.35); }
.bill-btn:active { transform: translateY(0); }
.bill-btn:disabled { background: var(--gray-500); cursor: not-allowed; transform: none; box-shadow: none; }

.form-error {
  background: #fff3cd; border: 1px solid #ffeeba; color: #856404;
  padding: 10px 14px; border-radius: 7px; font-size: .88rem;
  margin-bottom: 14px; display: none;
}
.form-error.show { display: block; }

/* ──────────────────────────────────────────────────────────
   ARTICLE / CONTENT
   ────────────────────────────────────────────────────────── */
.article-card {
  background: #fff; padding: 28px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.article-card h1 {
  font-size: 1.8rem; margin-bottom: 18px; color: var(--gray-900);
  line-height: 1.3;
}
.article-card h2 {
  font-size: 1.3rem; margin: 22px 0 10px; color: var(--primary);
  padding-left: 12px; border-left: 4px solid var(--primary);
}
.article-card h3 {
  font-size: 1.1rem; margin: 18px 0 8px; color: var(--gray-900);
}
.article-card p {
  margin-bottom: 14px; color: var(--gray-700); line-height: 1.75;
}
.article-card ul, .article-card ol {
  margin: 8px 0 16px 22px; color: var(--gray-700);
}
.article-card ul { list-style: disc; }
.article-card ol { list-style: decimal; }
.article-card li { margin-bottom: 6px; line-height: 1.7; }
.article-card a { color: var(--primary); font-weight: 600; }
.article-card strong { color: var(--gray-900); }

/* ──────────────────────────────────────────────────────────
   BLOG GRID
   ────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 16px;
}
.blog-card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: .2s;
  display: flex; flex-direction: column;
}
.blog-card:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none;
}
.blog-card-img {
  width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 3rem;
}
.blog-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.blog-card h3 {
  font-size: 1.05rem; line-height: 1.4; margin-bottom: 8px;
  color: var(--gray-900);
}
.blog-card p {
  font-size: .9rem; color: var(--gray-500); line-height: 1.5;
  margin-bottom: 12px; flex: 1;
}
.blog-card .blog-date {
  font-size: .78rem; color: var(--gray-500); margin-top: auto;
}

/* ──────────────────────────────────────────────────────────
   BILL READY PAGE
   ────────────────────────────────────────────────────────── */
.bill-ready-card {
  background: #fff; padding: 32px 24px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); text-align: center; margin-bottom: 18px;
}
.bill-ready-title {
  font-size: 1.5rem; margin-bottom: 8px; color: var(--gray-900);
  letter-spacing: .5px;
}
.bill-ready-subtitle {
  color: var(--gray-500); font-size: .95rem;
}

.ref-display {
  background: var(--gray-50); padding: 20px; border-radius: var(--radius);
  margin: 22px 0; text-align: center; border: 2px dashed var(--gray-300);
}
.ref-display .ref-label {
  font-size: .82rem; color: var(--gray-500); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.ref-display .ref-num {
  font-size: 1.6rem; color: var(--primary); font-weight: 700;
  word-break: break-all; letter-spacing: 2px;
}

.countdown-wrap {
  text-align: center; margin: 24px 0; padding: 20px;
  background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
  border-radius: var(--radius); border: 1px solid #ffd54f;
}
.countdown-wrap.ready {
  background: linear-gradient(135deg, #d4edda 0%, #a3d9b0 100%);
  border-color: #28a745;
}
.countdown-text {
  font-size: 1rem; color: #5a4900; margin-bottom: 8px; font-weight: 600;
}
.countdown-wrap.ready .countdown-text { color: #155724; }
.countdown-num {
  font-size: 3rem; font-weight: 700; color: #c0392b; line-height: 1;
}
.countdown-wrap.ready .countdown-num { color: #28a745; font-size: 2rem; }

.open-bill-btn {
  display: block; width: 100%; padding: 18px 24px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); font-size: 1.15rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: .15s;
  box-shadow: 0 6px 18px rgba(40,167,69,.35);
  margin: 16px 0;
}
.open-bill-btn:hover { background: #218838; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(40,167,69,.45); }
.open-bill-btn:active { transform: translateY(0); }
.open-bill-btn:disabled { background: var(--gray-300); cursor: not-allowed; box-shadow: none; }

.action-row {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
.action-row .btn-secondary {
  flex: 1; min-width: 140px; padding: 11px 18px;
  background: var(--gray-100); color: var(--gray-700);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-weight: 600; font-size: .88rem; text-align: center;
  text-decoration: none; transition: .15s; font-family: inherit;
  cursor: pointer;
}
.action-row .btn-secondary:hover {
  background: var(--gray-200); text-decoration: none;
}

/* Info card */
.info-box {
  background: #fff; padding: 22px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.info-box h4 {
  font-size: 1rem; margin-bottom: 12px; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.info-box ol { padding-left: 22px; color: var(--gray-700); }
.info-box ol li { font-size: .92rem; line-height: 1.9; }

/* ──────────────────────────────────────────────────────────
   ALERTS
   ────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: .92rem; border-left: 4px solid;
}
.alert-success { background: #d4edda; border-color: #28a745; color: #155724; }
.alert-danger  { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.alert-warning { background: #fff3cd; border-color: #ffc107; color: #856404; }
.alert-info    { background: #d1ecf1; border-color: #17a2b8; color: #0c5460; }

/* ──────────────────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-900); color: #aaa;
  padding: 40px 0 0; margin-top: 40px;
}
.footer-grid {
  display: grid; gap: 28px; padding-bottom: 30px;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-col h3 {
  color: #fff; font-size: 1.05rem; margin-bottom: 14px;
}
.footer-col p { font-size: .9rem; line-height: 1.7; color: #aaa; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #aaa; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2d2d2d; padding: 16px 0;
  text-align: center; font-size: .85rem;
}
.footer-bottom p { margin-bottom: 4px; }
.footer-disclaimer { font-size: .78rem; color: #666; }

/* ──────────────────────────────────────────────────────────
   UTILS
   ────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Page-not-found */
.not-found {
  text-align: center; padding: 80px 20px;
}
.not-found h1 { font-size: 4rem; color: var(--primary); margin-bottom: 8px; }
.not-found p { color: var(--gray-500); margin-bottom: 20px; }

/* Print */
@media print {
  .site-header, .site-footer, .nav-toggle, .nav-links,
  .open-bill-btn, .countdown-wrap, .action-row { display: none !important; }
  body { background: #fff; }
}
