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

/* Palette sampled directly from "Copy of BIDM Certificates.png" so the portal
   and the certificate it hands out read as one piece of design. */
:root {
  --navy:       #262262;  /* certificate title navy — primary brand colour */
  --navy-deep:  #151335;  /* the dark corner wedge / bottom band */
  --navy-text:  #34306C;  /* certificate body copy */
  --blue:       #114EA6;  /* royal blue diagonal */
  --gold:       #D7B254;  /* gold stripe */
  --gold-dark:  #C3983C;
  --gold-light: #E6DDA2;

  --dark:    #1c1a3a;
  --gray:    #5c5b73;
  --border:  #d8d9e3;
  --surface: #eff0f3;     /* silver-white of the certificate stock */
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--dark);
}

.page { display: none; flex-direction: column; height: 100vh; overflow: hidden; }
.page.active { display: flex; }
.hidden { display: none !important; }

/* ══ HEADER ══ */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 36px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gdg-logo-img { height: 34px; width: auto; display: block; flex-shrink: 0; }
/* Sized to stay on two lines at most, so a long institute name can be dropped
   in without breaking the header. */
.brand-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
  letter-spacing: 0.1px;
  max-width: 340px;
}
.header-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand-sub-right { font-size: 12px; color: var(--gray); font-weight: 600; }
.header-badge {
  font-size: 11px; font-weight: 700; color: var(--navy);
  background: #f7f5ee;
  border: 1.5px solid var(--gold);
  padding: 4px 12px; border-radius: 20px;
  white-space: nowrap;
}

/* Single navy→blue→gold band replaces the four-colour Google bar */
.color-bar {
  height: 4px;
  background: linear-gradient(90deg,
    var(--navy-deep) 0%, var(--navy) 28%, var(--blue) 58%,
    var(--gold-dark) 82%, var(--gold) 100%);
}

/* ══ MAIN ══ */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  background:
    radial-gradient(ellipse at 78% 8%,  rgba(17,78,166,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 4%  88%, rgba(215,178,84,0.14) 0%, transparent 52%),
    var(--surface);
  gap: 14px;
  overflow: hidden;
}

/* ══ PAGE HEADING ══ */
.page-heading { text-align: center; }

.page-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 14px; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--navy); margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(38,34,98,0.07);
}
.gold-line {
  width: 160px; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 8px;
}
.page-title {
  font-size: 28px; font-weight: 700;
  color: var(--navy); letter-spacing: -0.3px; margin-bottom: 4px;
}
.page-sub { font-size: 12px; color: var(--gray); }

/* ══ PORTAL CARD ══ */
.portal-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 28px 40px; width: 100%; max-width: 580px;
  box-shadow: 0 4px 24px rgba(21,19,53,0.10);
  position: relative;
}
.portal-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  border-radius: 8px 8px 0 0;
}
.portal-card-top {
  text-align: center; margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid #eceaf2;
}
.card-icon { margin-bottom: 10px; display: flex; justify-content: center; }
.portal-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.portal-desc { font-size: 13px; color: var(--gray); line-height: 1.6; max-width: 400px; margin: 0 auto; }
.portal-desc strong { color: var(--navy-text); }

/* ══ FORM ══ */
.form-label {
  display: block; font-size: 10px; font-weight: 700;
  color: var(--gray); letter-spacing: 0.8px;
  text-transform: uppercase; margin-bottom: 8px;
}
.input-row { display: flex; gap: 10px; }
.input-row input {
  flex: 1; padding: 12px 16px; font-size: 13px; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: 6px;
  outline: none; color: var(--dark); background: #fafafc;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-row input:focus {
  border-color: var(--navy); background: #fff;
  box-shadow: 0 0 0 3px rgba(38,34,98,0.12);
}
.input-row input::placeholder { color: #a9a8bb; }
#getBtn {
  padding: 12px 22px; background: var(--navy); color: #fff;
  border: none; border-radius: 6px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; display: flex; align-items: center;
  gap: 8px; white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(38,34,98,0.30);
}
#getBtn:hover    { background: #1b1849; }
#getBtn:disabled { background: #9b99b8; box-shadow: none; cursor: not-allowed; }
.error-msg { color: #c0392b; font-size: 12px; margin-top: 8px; }

.portal-card-footer {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--gray);
  padding-top: 14px; margin-top: 14px;
  border-top: 1px solid #eceaf2;
}
.footer-check { color: var(--gold-dark); font-size: 14px; font-weight: 700; }
.portal-card-footer strong { color: var(--navy-text); }

/* ══ LOADER ══ */
.loader {
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ INFO CARDS ══ */
.info-cards {
  display: flex; gap: 10px;
  width: 100%; max-width: 580px;
}
.info-card {
  flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 4px rgba(21,19,53,0.05);
  border-top: 2px solid var(--gold);
}
.info-card-text { display: flex; flex-direction: column; gap: 2px; }
.info-card-text strong { font-size: 11px; font-weight: 700; color: var(--navy); }
.info-card-text span   { font-size: 10px; color: var(--gray); }

/* ══ FOOTER ══ */
.site-footer {
  background: var(--navy-deep); border-top: 3px solid var(--gold-dark);
  padding: 12px 36px; flex-shrink: 0;
}
.footer-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: rgba(255,255,255,0.72);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--gold-light); text-decoration: none; font-size: 11px; }
.footer-links a:hover { text-decoration: underline; }

/* ══ NOT FOUND ══ */
.notfound-wrap {
  background:
    radial-gradient(ellipse at 82% 18%, rgba(215,178,84,0.16) 0%, transparent 52%),
    radial-gradient(ellipse at 8%  82%, rgba(17,78,166,0.10) 0%, transparent 52%),
    var(--surface);
  justify-content: center;
}
.notfound-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 40px 48px; width: 100%; max-width: 480px;
  box-shadow: 0 4px 24px rgba(21,19,53,0.10); text-align: center; position: relative;
}
.notfound-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  border-radius: 8px 8px 0 0;
}
.nf-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.nfd { width: 11px; height: 11px; border-radius: 50%; }
.nfd.b { background: var(--navy-deep); }
.nfd.r { background: var(--navy); }
.nfd.y { background: var(--blue); }
.nfd.g { background: var(--gold); }
.oops {
  font-size: 56px; font-weight: 900; letter-spacing: 5px; line-height: 1; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--navy-deep) 0%, var(--navy) 35%, var(--blue) 70%, var(--gold-dark) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nf-line { width: 160px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 0 auto 16px; }
.nf-title   { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.nf-desc    { font-size: 13px; color: var(--gray); line-height: 1.7; margin-bottom: 8px; }
.nf-contact { font-size: 12px; color: var(--gray); line-height: 1.7; margin-bottom: 22px; }
.nf-contact strong { color: var(--navy-text); }
.try-btn {
  padding: 11px 28px; background: var(--navy); color: #fff; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background 0.2s; box-shadow: 0 2px 10px rgba(38,34,98,0.30);
}
.try-btn:hover { background: #1b1849; }

/* ══ TOAST ══ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy); color: #fff;
  padding: 11px 22px; border-radius: 6px;
  border-left: 3px solid var(--gold);
  font-size: 13px; font-weight: 500; font-family: inherit;
  box-shadow: 0 4px 16px rgba(21,19,53,0.28);
  transition: transform 0.3s ease; z-index: 999;
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ══ RESPONSIVE ══ */
@media (max-width: 640px) {
  html, body { overflow: auto; }
  .page { height: auto; overflow: auto; }
  .header-inner {
    padding: 10px 16px;
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .brand-name   { font-size: 13px; max-width: none; }
  .header-right { width: 100%; justify-content: space-between; }
  .portal-card  { padding: 24px 20px; }
  .input-row    { flex-direction: column; }
  #getBtn       { justify-content: center; padding: 14px 22px; }
  .info-cards   { flex-direction: column; }
  .notfound-card { padding: 28px 20px; }
  .oops         { font-size: 42px; }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
  .site-footer  { padding: 12px 16px; }
  .page-title   { font-size: 22px; }
  .main-wrap    { justify-content: flex-start; padding-top: 24px; overflow: auto; }
}
