/* ============================================================================
   Student Ambassador Certificate Portal — replica stylesheet
   Reconstructed from certifications.kaushikieee.dev (compiled CSS, 119 rules).
   Base tokens + certificate-portal rules, verbatim where recoverable.
   ========================================================================== */

:root {
  --google-blue: #4285f4;
  --google-red: #ea4335;
  --google-yellow: #fbbc04;
  --google-green: #34a853;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { background: #fff; color: #202124; }

/* ---- root/body scope (matches .certificate-portal-root / -body) --------- */
@font-face {
  font-family: "Google Sans";
  src: url(certificates/GoogleSans-Bold.ttf) format("truetype");
  font-style: normal; font-weight: 400; font-display: swap;
}

.certificate-portal-root,
.certificate-portal-body {
  color: #202124;
  --lightningcss-light: initial;
  --lightningcss-dark: ;
  color-scheme: light;
  letter-spacing: 0;
  background: #fff;
  font-family: "Google Sans", sans-serif;
}
.certificate-portal-body { overflow-x: hidden; }

.certificate-portal, .certificate-portal * { box-sizing: border-box; }

.certificate-portal {
  --google-blue: #4285f4;
  --google-red: #ea4335;
  --google-yellow: #fbbc04;
  --google-green: #34a853;
  color: #202124;
  background: #fff;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Google Sans", sans-serif;
  display: flex;
}

/* ---- header ------------------------------------------------------------ */
.certificate-header {
  border-bottom: 1px solid #dadce0;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
}
.certificate-brand {
  color: #3c4043;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  line-height: 1.3;
  display: inline-flex;
}
.certificate-color-mark { align-items: center; gap: 3px; display: flex; }
.certificate-color-mark i { border-radius: 4px; width: 7px; height: 22px; }
.certificate-color-mark i:first-child { background: var(--google-blue); }
.certificate-color-mark i:nth-child(2) { background: var(--google-red); }
.certificate-color-mark i:nth-child(3) { background: var(--google-yellow); }
.certificate-color-mark i:nth-child(4) { background: var(--google-green); }
.certificate-header-label { color: #5f6368; font-size: 13px; }
.certificate-header-right { align-items: center; gap: 14px; display: flex; }
.certificate-header-right .certificate-back { flex-basis: 36px; width: 36px; height: 36px; }

/* ---- layout ------------------------------------------------------------ */
.certificate-content {
  flex: 1;
  place-items: center;
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 64px 0 56px;
  display: grid;
}
.certificate-content.is-hub { width: min(100% - 48px, 920px); padding: 52px 0 64px; display: block; }
.certificate-hub { width: 100%; animation: .42s ease-out both certificate-arrive; }

.certificate-hub-heading h1 {
  color: #202124; margin: 15px 0 0;
  font-size: clamp(30px, 4vw, 40px); font-weight: 400; line-height: 1.15;
}
.certificate-hub-heading > p { color: #5f6368; margin: 10px 0 0; font-size: 15px; }

/* ---- profile ----------------------------------------------------------- */
.certificate-profile {
  border-top: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  grid-template-columns: minmax(180px, .75fr) minmax(0, 1.8fr);
  align-items: center;
  gap: 30px;
  margin-top: 32px;
  padding: 20px 0;
  display: grid;
}
.certificate-profile-name, .certificate-profile-field { align-items: center; min-width: 0; display: flex; }
.certificate-profile-name { flex-direction: column; align-items: flex-start; gap: 5px; }
.certificate-profile-value { align-items: center; gap: 8px; width: 100%; display: flex; }
.certificate-profile-name > span, .certificate-profile-field > span { color: #5f6368; font-size: 12px; }
.certificate-profile-name > strong { color: #202124; font-size: 17px; font-weight: 400; }
.certificate-profile-fields { grid-template-columns: .6fr 1.4fr; gap: 22px; display: grid; }
.certificate-profile-field { flex-wrap: wrap; gap: 3px 12px; }
.certificate-profile-field > span { flex-basis: 100%; }
.certificate-profile-field > strong {
  overflow-wrap: anywhere; color: #202124; min-width: 0; font-size: 14px; font-weight: 400;
}
.certificate-copy-button {
  color: #5f6368; border: 1px solid #dadce0; border-radius: 4px;
  flex: 0 0 34px; place-items: center; width: 34px; height: 34px; margin-left: auto; display: grid;
  background: transparent; cursor: pointer;
}
.certificate-copy-button:hover { color: var(--google-blue); background: #f8f9fa; }
.certificate-copy-button:focus-visible { outline-offset: 3px; outline: 2px solid #202124; }
.certificate-profile .certificate-error { grid-column: 1 / -1; margin: -18px 0 0; }

/* ---- events ------------------------------------------------------------ */
.certificate-events { margin-top: 42px; }
.certificate-section-heading {
  border-bottom: 1px solid #dadce0; justify-content: space-between;
  align-items: end; padding-bottom: 14px; display: flex;
}
.certificate-section-heading h2 { color: #202124; margin: 6px 0 0; font-size: 23px; font-weight: 400; }
.certificate-event-count { color: #80868b; font-size: 12px; }
.certificate-event { padding: 22px 0 0; }
.certificate-event h3 { color: #202124; margin: 0; font-size: 18px; font-weight: 400; }
.certificate-event > p { color: #5f6368; max-width: 790px; margin: 10px 0 20px; font-size: 14px; line-height: 1.7; }
.certificate-event-links { border-top: 1px solid #e8eaed; margin: 0; padding: 0; list-style: none; }
.certificate-event-links li + li { border-top: 1px solid #e8eaed; }
.certificate-event-links a,
.certificate-event-link-state {
  color: #202124; grid-template-columns: 38px 1fr 24px; align-items: center;
  gap: 12px; width: 100%; min-height: 58px; font-size: 14px;
  transition: color .14s, background-color .14s;
  display: grid; text-decoration: none;
}
.certificate-event-links a:hover { color: #1a73e8; background: #f8fafd; }
.certificate-event-links a:focus-visible { outline: 2px solid var(--google-blue); outline-offset: 2px; }
.certificate-event-link-state { text-align: left; font: inherit; background: 0 0; border: 0; }
.certificate-event-link-state.is-opened { color: #5f6368; cursor: not-allowed; }
.certificate-event-link-state.is-locked { color: #9aa0a6; cursor: not-allowed; }
.certificate-event-link-state:disabled { opacity: 1; }
.certificate-event-link-state.is-opened svg { color: var(--google-green); }
.certificate-event-link-state.is-locked svg { color: #9aa0a6; }
.certificate-link-number { color: #80868b; font-size: 11px; }
.certificate-event-links svg { color: #5f6368; }
.certificate-gate-status { color: #70757a; min-height: 18px; margin: 20px 0 -18px; font-size: 12px; }
.certificate-hub-cta {
  color: #1a73e8; min-height: 48px; font: inherit; border: 1px solid #dadce0; border-radius: 4px;
  justify-content: center; align-items: center; gap: 10px; margin-top: 32px; padding: 0 18px;
  font-size: 14px; display: inline-flex; background: transparent; cursor: pointer;
}
.certificate-hub-cta:hover { background: #f8fafd; border-color: #c6dafc; }
.certificate-hub-cta:focus-visible { outline-offset: 3px; outline: 2px solid #202124; }
.certificate-hub-cta:disabled {
  color: #80868b; cursor: not-allowed; background: #f8f9fa; border-color: #dadce0;
}

/* ---- form -------------------------------------------------------------- */
.certificate-form-column { width: min(100%, 520px); animation: .42s ease-out both certificate-arrive; }
.certificate-eyebrow { color: #5f6368; align-items: center; gap: 9px; font-size: 13px; display: flex; }
.certificate-eyebrow svg { color: var(--google-blue); }
.certificate-form-column h1,
.certificate-result h1 {
  color: #202124; margin: 18px 0 0;
  font-size: clamp(28px, 4vw, 36px); font-weight: 400; line-height: 1.2;
}
.certificate-intro { color: #5f6368; margin: 10px 0 0; font-size: 16px; }
.certificate-form { flex-direction: column; align-items: stretch; display: flex; }
.certificate-form label { color: #202124; margin-bottom: 7px; font-size: 14px; }
.certificate-help { color: #5f6368; margin: 0 0 17px; font-size: 14px; line-height: 1.5; }
.certificate-form input {
  color: #202124; width: 100%; min-height: 54px; font: inherit; background: #fff;
  border: 1px solid #dadce0; border-radius: 4px; outline: 0; padding: 0 16px;
  font-size: 15px; transition: border-color .14s, box-shadow .14s;
}
.certificate-form input::placeholder { color: #80868b; }
.certificate-form input:hover { border-color: #9aa0a6; }
.certificate-form input:focus { border-color: var(--google-blue); box-shadow: 0 0 0 1px var(--google-blue); }

/* ---- buttons ----------------------------------------------------------- */
.certificate-primary, .certificate-secondary {
  min-height: 44px; font: inherit; cursor: pointer; border: 0; border-radius: 4px;
  justify-content: center; align-items: center; gap: 10px; padding: 0 18px;
  font-size: 14px; text-decoration: none;
  transition: background-color .14s, box-shadow .14s; display: inline-flex;
}
.certificate-primary { background: var(--google-blue); color: #fff; margin-top: 20px; }
.certificate-primary:hover:not(:disabled) { background: #1a73e8; box-shadow: 0 1px 3px #0003; }
.certificate-primary:disabled { cursor: not-allowed; opacity: .55; }
.certificate-primary:focus-visible,
.certificate-secondary:focus-visible,
.certificate-back:focus-visible { outline-offset: 3px; outline: 2px solid #202124; }
.certificate-actions { align-items: center; gap: 12px; display: flex; }
.certificate-actions .certificate-primary { flex: 1; }
.certificate-back {
  color: #5f6368; border: 1px solid #dadce0; border-radius: 4px; flex: 0 0 44px;
  place-items: center; width: 44px; height: 44px; display: grid; background: transparent; cursor: pointer;
}
.certificate-back:hover { background: #f8f9fa; }
.certificate-error { color: #b3261e; margin: 12px 0 0; font-size: 13px; line-height: 1.5; }
.certificate-independent-note { color: #70757a; margin: 28px 0 0; font-size: 12px; line-height: 1.55; }
.certificate-footer {
  color: #70757a; text-align: center; border-top: 1px solid #dadce0;
  place-items: center; min-height: 56px; padding: 12px 20px; font-size: 12px; display: grid;
}

/* ---- result ------------------------------------------------------------ */
.certificate-result { width: 100%; animation: .42s ease-out both certificate-arrive; }
.certificate-result-heading { justify-content: space-between; align-items: center; margin-bottom: 24px; display: flex; }
.certificate-result-heading h1 { margin-top: 10px; }
.certificate-preview {
  border: 1px solid #dadce0; width: 100%; height: auto; display: block;
  box-shadow: 0 4px 18px #20212412;
}
.certificate-result-actions { flex-wrap: wrap; gap: 12px; margin-top: 18px; display: flex; }
.certificate-result-actions .certificate-primary { margin-top: 0; }
.certificate-secondary { color: #3c4043; background: #fff; border: 1px solid #dadce0; }
.certificate-secondary:hover { background: #f8f9fa; }

/* ---- animation --------------------------------------------------------- */
@keyframes certificate-arrive {
  0% { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- mobile: (width <= 600px) ----------------------------------------- */
@media (width <= 600px) {
  .certificate-header { min-height: 64px; padding: 0 18px; }
  .certificate-brand { gap: 9px; font-size: 13px; }
  .certificate-header-label { font-size: 11px; }
  .certificate-color-mark i { width: 6px; height: 19px; }
  .certificate-content { width: calc(100% - 40px); padding: 44px 0 40px; }
  .certificate-content.is-hub { width: calc(100% - 40px); padding: 38px 0 48px; }
  .certificate-profile { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; padding: 18px 0; }
  .certificate-profile-fields { grid-template-columns: .65fr 1.35fr; gap: 12px; }
  .certificate-profile-field { column-gap: 7px; }
  .certificate-profile-field > strong { font-size: 12px; }
  .certificate-copy-button { flex-basis: 32px; width: 32px; height: 32px; }
  .certificate-events { margin-top: 32px; }
  .certificate-event-links a,
  .certificate-event-link-state { grid-template-columns: 28px 1fr 20px; gap: 8px; min-height: 54px; font-size: 13px; }
  .certificate-hub-cta { width: 100%; }
}

/* ---- reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .certificate-form-column, .certificate-result { animation: none; }
  .certificate-form input, .certificate-primary, .certificate-secondary { transition: none; }
}

/* ---- print ------------------------------------------------------------- */
@media print {
  .certificate-header, .certificate-footer, .certificate-result-heading,
  .certificate-result-actions, .certificate-independent-note { display: none !important; }
  .certificate-portal, .certificate-content, .certificate-result {
    width: 100%; min-height: 0; margin: 0; padding: 0; display: block;
  }
  .certificate-preview { width: 100vw; height: 100vh; box-shadow: none; object-fit: contain; border: 0; }
}
