/* ============================================================
   PTDF Scholarship Portal — Main Stylesheet
   Fonts: Playfair Display (headings) + Source Serif 4 (body)
   Palette: PTDF Green #006B3F, PTDF Gold #C8A900
============================================================ */

:root {
  --green:       #006B3F;
  --green-dark:  #004d2d;
  --green-light: #e8f5ee;
  --gold:        #C8A900;
  --gold-light:  #fdf8e1;
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --white:       #ffffff;
  --bg:          #f8f9fa;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 24px; border-radius: var(--radius); font-size: 15px;
  font-family: inherit; font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; transition: filter .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-green   { background: var(--green); color: #fff; }
.btn-gold    { background: var(--gold);  color: #1a1a1a; }
.btn-outline { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-full    { width: 100%; }
.btn-lg      { padding: 14px 32px; font-size: 16px; }
.btn-sm      { padding: 7px 14px; font-size: 13px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px;
  font-size: 14px; border-left: 4px solid;
}
.alert-error   { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
.alert-success { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.alert ul { margin: 8px 0 0 16px; }

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--green); box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo  { width: 38px; height: 38px; object-fit: contain; }
.nav-name  { font-family: 'Playfair Display', serif; font-size: 17px;
              color: #fff; font-weight: 700; letter-spacing: .4px; }
.nav-name span { color: var(--gold); }
.nav-cta { background: var(--gold); color: #1a1a1a; padding: 8px 20px;
            border-radius: var(--radius); font-weight: 700; font-size: 14px;
            transition: filter .15s; }
.nav-cta:hover { filter: brightness(1.1); text-decoration: none; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 520px;
  display: flex; align-items: center;
  background: var(--green); overflow: hidden; padding: 60px 0 40px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><circle cx="30" cy="30" r="1.5" fill="rgba(200,169,0,.15)"/></svg>') repeat;
  opacity: .6;
}
.hero-inner {
  position: relative; max-width: 780px; margin: 0 auto; padding: 0 24px;
  text-align: center;
}
.hero-badge {
  display: inline-block; background: var(--gold); color: #1a1a1a;
  padding: 5px 16px; border-radius: 20px; font-size: 13px; font-weight: 700;
  letter-spacing: .5px; margin-bottom: 20px; text-transform: uppercase;
}
.hero-title {
  font-family: 'Playfair Display', serif; font-size: clamp(32px, 5vw, 52px);
  color: #fff; line-height: 1.15; margin-bottom: 20px; font-weight: 800;
}
.hero-title em { color: var(--gold); font-style: normal; }
.hero-sub {
  color: rgba(255,255,255,.82); font-size: 17px; max-width: 600px;
  margin: 0 auto 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
}
.hero-scroll span {
  display: block; width: 24px; height: 24px; border-right: 2px solid rgba(255,255,255,.4);
  border-bottom: 2px solid rgba(255,255,255,.4); transform: rotate(45deg);
  animation: scrollBounce 1.5s infinite;
}
@keyframes scrollBounce { 0%,100%{transform:rotate(45deg) translateY(0)} 50%{transform:rotate(45deg) translateY(5px)} }

/* ── About strip ──────────────────────────────────────────── */
.about-strip { background: #fff; border-bottom: 1px solid var(--border); }
.strip-inner {
  max-width: 900px; margin: 0 auto; padding: 24px;
  display: flex; align-items: center; justify-content: space-around; flex-wrap: wrap; gap: 16px;
}
.strip-item { text-align: center; }
.strip-icon { font-size: 28px; margin-bottom: 4px; }
.strip-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.strip-divider { width: 1px; height: 40px; background: var(--border); }

/* ── Form section ─────────────────────────────────────────── */
.form-section { padding: 60px 20px; }
.form-container {
  max-width: 720px; margin: 0 auto;
  background: #fff; border-radius: 10px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.form-header {
  background: var(--green); padding: 32px 40px; color: #fff;
}
.form-header h2 {
  font-family: 'Playfair Display', serif; font-size: 26px; margin-bottom: 6px;
}
.form-header p { color: rgba(255,255,255,.75); font-size: 14px; }
.req { color: var(--gold); font-weight: 700; }

/* Steps indicator */
.steps {
  display: flex; align-items: center; padding: 24px 40px 0;
  gap: 0;
}
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: color .2s;
}
.step span {
  width: 28px; height: 28px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-muted); transition: all .2s;
}
.step.active { color: var(--green); }
.step.active span { background: var(--green); color: #fff; }
.step.done span { background: var(--gold); color: #1a1a1a; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }

/* Form steps */
.form-step { display: none; padding: 28px 40px 32px; border: none; }
.form-step.active { display: block; }
.form-step legend { display: none; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text); }
.field small { font-size: 12px; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 15px; color: var(--text);
  transition: border-color .15s, box-shadow .15s; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,107,63,.12);
}
.field textarea { resize: vertical; min-height: 140px; }
.field-row { margin-bottom: 20px; }
.field-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.radio-group { display: flex; gap: 20px; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio-label input { width: 16px; height: 16px; cursor: pointer; }

/* File upload */
.file-upload { position: relative; }
.file-upload input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2;
  width: 100%; height: 100%;
}
.file-upload-ui {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; background: #fafafa; transition: border-color .2s;
}
.file-upload:hover .file-upload-ui { border-color: var(--green); }
.file-upload-icon { font-size: 32px; margin-bottom: 8px; }
.file-upload-text { font-weight: 600; font-size: 15px; color: var(--text); }
.file-upload-hint { font-size: 13px; color: var(--text-muted); }
.photo-preview { display: none; width: 100px; height: 120px; object-fit: cover;
                  border-radius: var(--radius); margin: 12px auto 0; border: 2px solid var(--green); }

.word-count { display: block; text-align: right; }

.declaration {
  background: var(--green-light); padding: 14px 16px;
  border-radius: var(--radius); margin-bottom: 20px;
}
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.checkbox-label input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }

.step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ── Success page ─────────────────────────────────────────── */
.success-page {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.success-card {
  max-width: 540px; width: 100%; background: #fff;
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 48px 40px; text-align: center;
}
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-card h1 { font-family: 'Playfair Display', serif; font-size: 28px; color: var(--green); margin-bottom: 8px; }
.success-name { font-size: 17px; margin-bottom: 12px; color: var(--text-muted); }
.success-ref {
  background: var(--green-light); border: 1px solid var(--green);
  border-radius: var(--radius); padding: 16px; margin: 20px 0;
}
.ref-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--green); margin-bottom: 4px; }
.ref-value  { font-size: 18px; font-weight: 700; color: var(--green); }
.success-next { text-align: left; margin: 20px 0; }
.success-next h3 { font-size: 15px; margin-bottom: 8px; }
.success-next ol { padding-left: 20px; font-size: 14px; line-height: 1.8; color: var(--text-muted); }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ── Search page ──────────────────────────────────────────── */
.search-page { max-width: 700px; margin: 60px auto; padding: 0 20px; }
.search-container { background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: 40px; }
.search-container h1 { font-family: 'Playfair Display', serif; font-size: 28px; color: var(--green); margin-bottom: 8px; }
.search-container > p { color: var(--text-muted); margin-bottom: 24px; }
.search-form { margin-bottom: 24px; }
.search-input-wrap { display: flex; gap: 10px; }
.search-input { flex: 1; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 15px; }
.search-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,107,63,.12); }
.search-empty { text-align: center; padding: 32px; color: var(--text-muted); }
.results-count { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.result-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; gap: 16px;
}
.result-name  { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.result-meta  { font-size: 13px; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.result-ref   { font-size: 12px; color: var(--green); margin-top: 4px; font-family: monospace; }
.result-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Profile/Award page ───────────────────────────────────── */
.profile-page { max-width: 860px; margin: 0 auto; padding: 40px 20px 60px; }
.not-found { text-align: center; padding: 80px 20px; }
.not-found-icon { font-size: 56px; margin-bottom: 16px; }
.not-found h1 { font-family: 'Playfair Display', serif; font-size: 28px; margin-bottom: 8px; }
.not-found p { color: var(--text-muted); margin-bottom: 12px; }

.award-page {}
.verified-banner {
  background: var(--green); color: #fff; text-align: center;
  padding: 10px 20px; border-radius: var(--radius); margin-bottom: 20px;
  font-size: 14px; font-weight: 600;
}
.verified-icon { margin-right: 6px; }

/* Award letter card — mimics the real letter */
.award-card {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 40px; border-top: 6px solid var(--green);
}

/* Letter header */
.letter-header {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px;
}
.letter-header-left { flex-shrink: 0; }
.letter-logo { width: 64px; }
.letter-header-centre { flex: 1; text-align: center; }
.letter-header-centre h1 {
  font-family: 'Playfair Display', serif; font-size: 17px;
  color: var(--green); margin-bottom: 4px; font-weight: 800;
}
.letter-header-centre p { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.letter-header-right { flex-shrink: 0; }
.letter-photo { width: 70px; height: 85px; object-fit: cover; border: 2px solid var(--green); }
.letter-photo-placeholder {
  width: 70px; height: 85px; background: #f3f4f6; border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-muted);
}

.letter-divider { height: 2px; background: var(--gold); margin: 12px 0 16px; }

.letter-meta { display: flex; justify-content: space-between; margin-bottom: 16px; font-size: 13px; }
.letter-date { color: var(--text-muted); }
.letter-refs  { text-align: right; }
.letter-refid { font-weight: 700; color: var(--text); font-size: 13px; }
.letter-shortid { color: var(--text-muted); font-size: 12px; }

.letter-recipient { margin-bottom: 16px; font-size: 14px; line-height: 1.6; }
.letter-subject {
  font-weight: 800; font-size: 14px; text-transform: uppercase;
  margin-bottom: 14px; line-height: 1.5;
}
.letter-intro { font-size: 14px; margin-bottom: 16px; line-height: 1.7; }

/* Award table */
.award-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 20px; }
.award-table thead th {
  background: var(--green); color: #fff; padding: 8px 12px; text-align: left; font-weight: 700;
}
.award-table thead th:first-child { width: 42px; }
.award-table tbody tr:nth-child(even) { background: #f9f9f9; }
.award-table tbody td { padding: 8px 12px; border: 1px solid #e0e0e0; vertical-align: top; }
.award-table tbody td:first-child { text-align: center; font-weight: 600; }
.award-table tbody td:nth-child(2) { font-weight: 600; width: 220px; }

.letter-conditions { font-size: 13px; line-height: 1.7; margin-bottom: 20px; }
.letter-conditions p { margin-bottom: 6px; }

.letter-footer-row { display: flex; justify-content: space-between; align-items: flex-start; }
.letter-sig { }
.sig-img   { max-width: 120px; margin-bottom: 4px; }
.stamp-img { max-width: 70px; margin-bottom: 4px; }
.sig-name  { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.sig-title { font-size: 13px; color: var(--text-muted); }
.letter-qr { text-align: right; }
.qr-caption { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.qr-img { width: 90px; height: 90px; margin-left: auto; }

.download-bar {
  margin-top: 24px; display: flex; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.download-note { font-size: 13px; color: var(--text-muted); }

/* ── Status badges ────────────────────────────────────────── */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; text-transform: capitalize;
}
.status-badge.pending   { background: #fef3c7; color: #92400e; }
.status-badge.approved  { background: #d1fae5; color: #065f46; }
.status-badge.rejected  { background: #fee2e2; color: #7f1d1d; }
.status-badge.lg        { font-size: 14px; padding: 5px 14px; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { background: var(--green); color: rgba(255,255,255,.7); padding: 28px 0; margin-top: 60px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-logo  { width: 44px; opacity: .9; }
.footer-name  { color: #fff; font-weight: 700; }
.footer-addr  { font-size: 12px; }
.footer-links { display: flex; gap: 20px; font-size: 14px; }
.footer-links a { color: var(--gold); }
.footer-copy  { font-size: 12px; }

/* ── Admin login ──────────────────────────────────────────── */
.admin-login-body { background: var(--green); }
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 48px 40px; width: 100%; max-width: 400px; text-align: center;
}
.login-logo { margin: 0 auto 16px; width: 72px; height: 72px; }
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-card h1 {
  font-family: 'Playfair Display', serif; font-size: 26px;
  color: var(--green); margin-bottom: 4px;
}
.login-card > p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-form { text-align: left; }
.login-form .field { margin-bottom: 16px; }
.login-form .btn  { margin-top: 8px; }
.login-back { display: block; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .field-row.two-col { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .award-card { padding: 20px; }
  .letter-header { flex-direction: column; align-items: center; text-align: center; }
  .letter-footer-row { flex-direction: column; gap: 20px; }
  .letter-qr { text-align: left; }
  .steps { padding: 16px 20px 0; }
  .form-step { padding: 20px; }
  .form-header { padding: 24px 20px; }
  .search-input-wrap { flex-direction: column; }
}
