/* ===== GREEN LOCAL NEWS - BASE STYLES ===== */

/* RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #f4f6f8;
  color: #222;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER ===== */
.site-header {
  background: #1b5e20;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.logo-icon { font-size: 28px; }

.logo-text .site-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.logo-text .site-tagline {
  font-size: 11px;
  color: #a5d6a7;
  letter-spacing: 0.5px;
}

.header-location {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
}

.header-location .loc-icon { font-size: 16px; }
.header-location #headerLocationName { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-location .change-loc-btn {
  background: none;
  border: none;
  color: #a5d6a7;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.header-location .change-loc-btn:hover { color: #fff; }

/* ===== NAVIGATION ===== */
.site-nav {
  background: #2e7d32;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 4px;
}

.nav-link {
  color: #c8e6c9;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  display: block;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  border-bottom-color: #81c784;
  text-decoration: none;
}

.nav-link.nav-submit {
  margin-left: auto;
  background: #ff6f00;
  color: #fff;
  border-radius: 6px;
  border-bottom: none;
  padding: 8px 16px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.nav-link.nav-submit:hover { background: #e65100; }

/* ===== FOOTER ===== */
.site-footer {
  background: #1a1a2e;
  color: #ccc;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand .brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  color: #999;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 8px; }

.footer-col ul li a {
  color: #999;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: #81c784; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #666;
}

.footer-bottom a { color: #666; }
.footer-bottom a:hover { color: #81c784; }

/* ===== UTILITIES ===== */
.text-green { color: #2e7d32; }
.text-muted { color: #999; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-breaking { background: #c62828; color: #fff; }
.badge-featured { background: #ff6f00; color: #fff; }
.badge-new { background: #2e7d32; color: #fff; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-green { background: #2e7d32; color: #fff; }
.btn-green:hover { background: #1b5e20; color: #fff; text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 2px solid #2e7d32;
  color: #2e7d32;
}
.btn-outline:hover { background: #2e7d32; color: #fff; text-decoration: none; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.alert-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #333; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.form-control:focus { border-color: #2e7d32; }

textarea.form-control { resize: vertical; min-height: 120px; }

/* ===== PAGE WRAPPER ===== */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.card-body { padding: 20px; }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: #1a1a2e; }

/* ===== RESPONSIVE NAV ===== */
@media (max-width: 600px) {
  .header-top { flex-wrap: wrap; }
  .header-location { display: none; }
  .nav-inner { overflow-x: auto; }
  .nav-link { white-space: nowrap; padding: 10px 12px; font-size: 13px; }
  .logo-text .site-name { font-size: 18px; }
}
/* ============================================================
   AUTH PAGES (login.php, register.php, terms.php)
   None of this existed before — the whole form was rendering
   with zero layout, padding, or visual hierarchy at all.
   ============================================================ */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

body.auth-page {
    background: #f4f6f5;
    margin: 0;
    font-family: 'Source Sans 3', Arial, sans-serif;
    color: #222;
}

.auth-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
}

.site-logo {
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
}
.site-logo .logo-green { color: #2e7d32; }
.site-logo .logo-local { color: #1a1a2e; }
.site-logo .logo-news  { color: #666; }

.auth-main {
    display: flex;
    justify-content: center;
    padding: 40px 20px 60px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 36px 40px;
    width: 100%;
    max-width: 460px;
}

.auth-card-wide { max-width: 620px; }

.auth-card-header { text-align: center; margin-bottom: 24px; }
.auth-icon { font-size: 40px; margin-bottom: 8px; }
.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    margin: 0 0 6px;
    color: #1a1a2e;
}
.auth-subtitle { color: #666; font-size: 15px; margin: 0; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
}
.alert-icon { flex-shrink: 0; }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.form-label .required { color: #c62828; margin-left: 2px; }
.form-label .optional { color: #999; font-weight: 400; font-size: 12px; margin-left: 4px; }

.form-input {
    padding: 11px 13px;
    border: 2px solid #ddd;
    border-radius: 7px;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.15s;
}
.form-input:focus {
    outline: none;
    border-color: #2e7d32;
}
.form-input-short { max-width: 160px; }

.form-group.has-error .form-input { border-color: #c62828; }

.field-error {
    color: #c62828;
    font-size: 13px;
    font-weight: 600;
}
.field-hint {
    color: #888;
    font-size: 12.5px;
}

.input-with-toggle { position: relative; display: flex; }
.input-with-toggle .form-input { padding-right: 42px; }
.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.password-strength {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.strength-bar {
    flex: 1;
    height: 5px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.2s, background-color 0.2s;
}
.strength-label { font-size: 12px; font-weight: 600; white-space: nowrap; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.auth-link { color: #2e7d32; text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-link-muted { color: #888; text-decoration: none; font-size: 14px; }
.auth-link-muted:hover { color: #2e7d32; }

.btn-auth-submit {
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-auth-submit:hover { background: #1b5e20; }

.auth-card-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: #666;
}
.auth-card-footer p { margin: 6px 0; }

.auth-footer {
    text-align: center;
    padding: 24px 0;
    color: #888;
    font-size: 13px;
}
.auth-footer a { color: #888; }
.auth-footer a:hover { color: #2e7d32; }

/* ---- Terms of Use popup ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-box {
    background: #fff;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #eee;
}
.modal-header h2 { margin: 0; font-size: 20px; color: #1a1a2e; }
.modal-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.modal-close:hover { color: #222; }
.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}
.modal-body h3 { font-size: 15px; color: #1a1a2e; margin: 18px 0 6px; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body ul { margin: 6px 0; padding-left: 22px; }
.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid #eee;
    text-align: right;
}
.modal-footer .btn-auth-submit { width: auto; padding: 10px 24px; }

@media (max-width: 600px) {
    .auth-card { padding: 26px 22px; }
    .form-row { grid-template-columns: 1fr; }
}

/* ---- HEADER ACTION BUTTONS (used on dashboard.php's auth-style header) ---- */
body.auth-page .header-top .btn-nav {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #2e7d32;
    color: #2e7d32;
    background: #fff;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    margin-left: 8px;
}

body.auth-page .header-top .btn-nav:hover {
    background: #2e7d32;
    color: #fff;
}

body.auth-page .header-top .btn-nav.btn-submit {
    background: #2e7d32;
    color: #fff;
}

body.auth-page .header-top .btn-nav.btn-submit:hover {
    background: #1b5e20;
    border-color: #1b5e20;
}

body.auth-page .header-top .btn-nav.btn-outline {
    background: transparent;
    color: #2e7d32;
}

body.auth-page .header-top .btn-nav.btn-outline:hover {
    background: #2e7d32;
    color: #fff;
}
