/* All Saints' Secondary School Oyigbo — Document Verification Portal
   Aesthetic: Refined academic authority — navy, royal blue, gold
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --navy:        #1B2A6B;
  --royal:       #2B47C8;
  --royal-lt:    #4A66E0;
  --gold:        #C9A84C;
  --gold-lt:     #E4C97A;
  --cream:       #F9F7F2;
  --cream-dk:    #F0EDE4;
  --slate:       #5A6475;
  --border:      #D6D0C4;
  --green:       #1D6B45;
  --red:         #7A1A1A;
  --white:       #FFFFFF;
  --radius:      6px;
  --shadow:      0 4px 28px rgba(27,42,107,.10);
  --shadow-lg:   0 12px 48px rgba(27,42,107,.18);
}

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

body.asv-page {
  background: var(--cream);
  font-family: 'Outfit', sans-serif;
  color: var(--navy);
  min-height: 100vh;
}

/* ── Portal wrapper ── */
.asv-portal {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── Header ── */
.asv-header {
  padding: 36px 0 28px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  position: relative;
}
.asv-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  margin: 16px auto 0;
  border-radius: 2px;
}
.asv-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}
.asv-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(27,42,107,.15));
}
.asv-school-info { text-align: left; }
.asv-school-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -.3px;
}
.asv-school-location {
  font-size: .72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 600;
  margin-top: 2px;
}
.asv-school-motto {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: .85rem;
  color: var(--slate);
  margin-top: 3px;
}
.asv-portal-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--slate);
  font-weight: 500;
  margin-top: 10px;
}

/* ── Search card ── */
.asv-search-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.asv-search-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy), var(--royal), var(--navy));
}
.asv-search-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.asv-search-card p {
  font-size: .88rem;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 24px;
}
.asv-search-row { display: flex; gap: 10px; }
.asv-search-row input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: .92rem;
  color: var(--navy);
  background: var(--cream);
  transition: border-color .2s, background .2s;
}
.asv-search-row input:focus {
  outline: none;
  border-color: var(--royal);
  background: var(--white);
}
.asv-btn {
  padding: 12px 26px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.asv-btn-primary {
  background: var(--navy);
  color: var(--white);
  letter-spacing: .4px;
}
.asv-btn-primary:hover { background: #0f1e54; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27,42,107,.25); }
.asv-btn-gold {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
}
.asv-btn-gold:hover { background: var(--gold-lt); }
.asv-search-hint {
  margin-top: 10px;
  font-size: .76rem;
  color: var(--slate);
}
.asv-search-hint code {
  background: var(--cream-dk);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: .74rem;
}
#asv-search-msg { margin-top: 12px; font-size: .84rem; font-weight: 500; display: none; }
#asv-search-msg.error { color: var(--red); }

/* ── Result card ── */
.asv-result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.asv-result-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3580 60%, var(--royal) 100%);
  padding: 26px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.asv-result-header.invalid-header { background: linear-gradient(135deg, var(--red), #9e2020); }

.asv-check-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.asv-check-circle.verified { background: rgba(29,107,69,.5); border-color: rgba(29,107,69,.7); }
.asv-check-circle.invalid  { background: rgba(122,26,26,.5); border-color: rgba(255,255,255,.2); }
.asv-check-circle svg { stroke: #fff; fill: none; stroke-width: 2.5; width: 26px; height: 26px; }

.asv-result-header-text h2 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.asv-result-header-text p {
  color: rgba(255,255,255,.6);
  font-size: .7rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Tricolour bar - navy, gold, royal */
.asv-tribar {
  height: 4px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 33%, var(--gold) 33%, var(--gold) 66%, var(--royal) 66%);
}

.asv-result-body { padding: 32px; }

/* School crest watermark on results */
.asv-result-body { position: relative; }
.asv-result-body::after {
  content: '';
  position: absolute;
  top: 50%; right: 24px;
  transform: translateY(-50%);
  width: 120px; height: 120px;
  background: url('../school-logo.webp') center/contain no-repeat;
  opacity: .04;
  pointer-events: none;
}

/* ── Meta grid ── */
.asv-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.asv-meta-field {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.asv-meta-field:nth-child(odd)  { border-right: 1px solid var(--border); }
.asv-meta-field:nth-last-child(-n+2) { border-bottom: none; }
.asv-meta-field.full { grid-column: 1 / -1; border-right: none; }
.asv-field-label {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--royal);
  font-weight: 600;
  margin-bottom: 4px;
}
.asv-field-value {
  font-size: .92rem;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.4;
}
.asv-field-value.large {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.asv-field-value.status-current {
  color: var(--green);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.asv-field-value.status-current::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0;
}
.asv-field-value.status-superseded {
  color: var(--red);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.asv-field-value.approved {
  color: var(--green);
  display: flex; align-items: center; gap: 5px;
}
.asv-field-value.approved::before {
  content: '✓';
  font-size: .8rem;
  font-weight: 700;
}
.asv-field-value.pending { color: #8a6200; }

/* ── QR section ── */
.asv-qr-section {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.asv-qr-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  flex-shrink: 0;
  position: relative;
}
/* Corner marks on QR */
.asv-qr-wrap::before, .asv-qr-wrap::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--navy);
  border-style: solid;
}
.asv-qr-wrap::before { top: 4px; left: 4px; border-width: 2px 0 0 2px; }
.asv-qr-wrap::after  { bottom: 4px; right: 4px; border-width: 0 2px 2px 0; }
.asv-qr-wrap img { display: block; }
.asv-qr-info h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}
.asv-qr-info p {
  font-size: .8rem;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 12px;
}
.asv-timestamp {
  font-size: .72rem;
  color: var(--slate);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.asv-timestamp::before { content: '🔒'; font-size: .7rem; }

/* ── Invalid card ── */
.asv-invalid-card {
  background: var(--white);
  border: 1px solid #e8c5c5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.asv-invalid-body { padding: 28px 32px; }
.asv-invalid-body p {
  color: var(--slate);
  font-size: .9rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

/* ── Footer ── */
.asv-footer {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .74rem;
  color: var(--slate);
  line-height: 1.85;
}
.asv-footer strong { color: var(--navy); }
.asv-footer .motto {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--gold);
  font-size: .82rem;
  display: block;
  margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .asv-portal { padding: 0 16px 60px; }
  .asv-header { padding: 24px 0 20px; }
  .asv-logo-row { flex-direction: column; text-align: center; gap: 10px; }
  .asv-school-info { text-align: center; }
  .asv-search-card { padding: 24px 18px; }
  .asv-search-row { flex-direction: column; }
  .asv-result-body { padding: 20px 18px; }
  .asv-result-header { padding: 20px 18px; }
  .asv-meta-grid { grid-template-columns: 1fr; }
  .asv-meta-field:nth-child(odd) { border-right: none; }
  .asv-meta-field:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .asv-meta-field:last-child { border-bottom: none; }
  .asv-qr-section { flex-direction: column; }
}
