/* =========================================================
   1. BASE RESET & VARIABLES
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-light: #e5e7eb;
  --text-primary: #1f2937;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --success: #22c55e;
  --danger: #dc2626;
  --radius: 14px;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-page);
  color: var(--text-primary);
}

/* =========================================================
   2. PAGE CONTAINER
   ========================================================= */

.page-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

/* =========================================================
   3. FORM CARD
   ========================================================= */

form.register {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

/* =========================================================
   4. HEADINGS & TEXT
   ========================================================= */

h1 {
  font-size: 28px;
  font-weight: 700;
  color: #14532d;
  margin-bottom: 6px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  color: #166534;
  margin: 24px 0 12px;
}

p {
  margin: 6px 0;
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================================================
   5. FORM LAYOUT
   ========================================================= */

fieldset {
  border: none;
  padding: 0;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: block;
}

/* =========================================================
   6. INPUTS & SELECTS
   ========================================================= */

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #ffffff;
}

input::placeholder {
  color: #9ca3af;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* =========================================================
   7. INFO / NOTE BOX
   ========================================================= */

.info-box {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* =========================================================
   8. CITY SELECTION GRID
   ========================================================= */

.city-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.city-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.city-item:hover {
  background: #f1f5f9;
  border-color: #c7d2fe;
}

.city-item:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 600;
}

/* =========================================================
   9. DECLARATION SECTION
   ========================================================= */

.declaration-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  background: #f9fafb;
}

.declaration-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.declaration-item p {
  font-size: 13px;
  color: var(--text-primary);
}

/* =========================================================
   10. TABLES
   ========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border: 1px solid var(--border-light);
  padding: 10px;
}

th {
  background: #f1f5f9;
  text-align: left;
}

/* ===============================
   FORM ACTION BUTTONS (FIXED)
   =============================== */

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

/* Base button */
.btn {
  min-width: 120px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Primary: Submit */
.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Secondary: Reset */
.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

/* Disabled (future-proof) */
.btn:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

/* =========================================================
   12. UTILITIES
   ========================================================= */

.required {
  color: var(--danger);
  font-weight: 700;
}

.center {
  margin-left: auto;
  margin-right: auto;
}

/* ===============================
   FIELDSET / LEGEND HEADINGS
   =============================== */

fieldset {
  border: none;
  margin: 0 0 32px;
  padding: 0;
}

legend {
  font-size: 20px;
  font-weight: 600;
  color: #14532d;

  padding: 0;
  margin-bottom: 16px;

  display: block;
  width: 100%;
}

/* Optional subtle divider under legend */
legend::after {
  content: "";
  display: block;
  height: 1px;
  background: #e5e7eb;
  margin-top: 8px;
}

/* ===============================
   TOP BAR (Logout Section)
   =============================== */

.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.welcome-text {
  font-size: 13px;
  color: #6b7280;
}

.logout-btn {
  background: #ef4444;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.logout-btn:hover {
  background: #dc2626;
}

/* ===============================
   ADMIN DASHBOARD (USER MANAGEMENT)
   =============================== */
   .admin-actions {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #2e6da4;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    min-width: 220px;
    text-align: center;
    transition: background-color 0.2s ease;
}

.admin-btn:hover {
    background-color: #204d74;
}
