@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
  /* Light, professional palette aligned with provided colors */
  --bg: #f8f9f9;               /* page background */
  --card: #ffffff;             /* cards */
  --text: #0f172a;             /* default text */
  --muted: #64748b;            /* secondary text */
  --heading: #00008b;          /* deep blue headings */
  --primary: #990000;          /* maroon accent (buttons/ctas) */
  --primary-600: #8a0000;      /* hover */
  --primary-700: #7a0000;      /* active */
  --primary-contrast: #ffffff; /* text over primary */
  --success: #107a2e;          /* success */
  --danger: #b42318;           /* error */
  --border: #e5e7eb;           /* subtle borders */
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.container { width: 100%; max-width: 960px; margin: 0; }
/* Push content a bit lower than strict center */
.center-offset { transform: translateY(6vh); }
@media (max-width: 760px) { .center-offset { transform: translateY(2vh); } }

h1 { font-weight: 800; letter-spacing: -0.02em; color: var(--heading); text-align: center; }
h2 { color: var(--heading); }
.form-card h2 { text-align: center; }

a { color: var(--heading); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  margin: 16px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.07);
}

.card.form-card { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 16px;
}

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
}

label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

label.full { grid-column: 1 / -1; }

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 12px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

input[type="email"] { padding: 12px 36px 12px 38px; }

input::placeholder { color: var(--muted); opacity: 1; }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.15); }

.with-icon { position: relative; }
.with-icon::before {
  content: '';
  position: absolute;
  top: 38px; left: 12px;
  width: 18px; height: 18px;
  opacity: 0.6;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}

input[type="file"] {
  display: block;
}

.actions { margin-top: 14px; }

button {
  background: var(--primary);
  color: var(--primary-contrast);
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, filter 120ms ease, transform 40ms ease;
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
button:hover { background: var(--primary-600); }
button:active { background: var(--primary-700); transform: translateY(0.5px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.2); }

.result { margin-top: 12px; }

.status { color: var(--muted); font-size: 14px; margin-top: 8px; }

.success { color: var(--success); font-weight: 700; }
.error { color: var(--danger); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none; }

.certificate {
  background: #fff;
  color: #111827;
  border: 10px solid #e5e7eb;
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1.4142 / 1; /* A4 landscape ratio approximated */
  max-height: 480px;
  margin: 12px 0;
  display: grid;
  place-items: center;
  position: relative;
}

.cert-inner { width: 88%; text-align: center; }

.cert-header {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 12px;
}

.cert-body { margin: 18px 0; }
.cert-body h3 { font-size: 26px; margin: 4px 0; }
.cert-body h4 { font-size: 20px; margin: 4px 0; font-weight: 600; }

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.cert-footer .line {
  width: 220px;
  height: 1px;
  background: #1f2937;
  margin: 6px auto 2px;
}
