/* ===========================================================================
   EIA TECH — certificate generator + login (single stylesheet)
   generator styles are global; login is scoped under .login
   =========================================================================== */
:root {
  --red: #e30613;
  --red-d: #b80410;
  --bg: #0d0f13;
  --bg2: #14171d;
  --card: #181c23;
  --card2: #1e232b;
  --line: #2a303a;
  --line2: #343b47;
  --txt: #e9ecf1;
  --muted: #8b919e;
  --faint: #5b626f;
  --field: #11141a;
  --ok: #39d98a;
  --radius: 12px;
  --top: 56px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}
.i {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

/* ---------- buttons (shared) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, var(--red), var(--red-d));
  transition: 0.14s;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.btn.ghost {
  background: var(--card2);
  border: 1px solid var(--line2);
  color: var(--txt);
  font-weight: 600;
}
.btn.ghost:hover {
  border-color: var(--red);
  color: #fff;
  filter: none;
}
.btn.ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--line2);
  color: var(--txt);
}
.btn.sm {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 9px;
}
.btn .i {
  width: 16px;
  height: 16px;
}

/* ---------- inputs (shared) ---------- */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 0 5px;
}
.hint {
  color: var(--faint);
  font-weight: 400;
  font-size: 11px;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--txt);
  font: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}
input[type='date'] {
  color-scheme: dark;
}
input[type='date']::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  opacity: 1;
  cursor: pointer;
}
select {
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}
textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
  font-size: 13px;
}
.grid2 {
  display: flex;
  gap: 10px;
}
.grid2 > div {
  flex: 1;
  min-width: 0;
}

/* ---------- topbar ---------- */
.topbar {
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, #1a1e25, #14171d);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(227, 6, 19, 0.35);
}
.topbar .logo {
  height: 28px;
  width: auto;
}
.topbar .title {
  font-weight: 600;
  letter-spacing: 0.3px;
}
.topbar .title b {
  color: var(--red);
}
.topbar .sp {
  flex: 1;
}
.topbar .badge {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line2);
  padding: 5px 11px;
  border-radius: 20px;
}

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  height: calc(100vh - var(--top));
}
.formpane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg2);
  border-right: 1px solid var(--line);
}
.formscroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 6px;
}
.formscroll::-webkit-scrollbar {
  width: 9px;
}
.formscroll::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 9px;
}
.formfoot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
.formfoot .btn {
  width: 100%;
}
.err {
  color: #ff6b74;
  font-size: 12px;
  margin-top: 9px;
  min-height: 14px;
  text-align: center;
}

/* ---------- cards / sections ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.seclabel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 8px;
}
.seclabel .i {
  width: 15px;
  height: 15px;
}

/* ---------- gender segmented ---------- */
.seg {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}
.seg label {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 10px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  background: var(--card2);
  user-select: none;
}
.seg input {
  display: none;
}
.seg label:has(input:checked) {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ---------- viewer ---------- */
.viewpane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0a0c10;
}
.vbar {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.vbar .vt {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.4px;
}
.vbar .sp {
  flex: 1;
}
.stage {
  flex: 1;
  position: relative;
  min-height: 0;
}
.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}
.ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--faint);
  text-align: center;
  padding: 30px;
}
.ph img {
  height: 38px;
  opacity: 0.5;
}
.ph .big {
  font-size: 15px;
  color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .formpane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .formscroll {
    overflow: visible;
    padding-bottom: 14px;
  }
  .viewpane {
    height: 80vh;
  }
}
@media (max-width: 480px) {
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }
  .topbar .badge {
    display: none;
  }
  .topbar .title {
    font-size: 13px;
  }
  .grid2 {
    flex-direction: column;
    gap: 0;
  }
  .vbar .vt {
    display: none;
  }
}

/* =================== LOGIN =================== */
body.login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login .box {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(227, 6, 19, 0.35) inset;
  padding: 28px 26px 24px;
}
.login .logo {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.login .logo img {
  height: 34px;
}
.login h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0 0 4px;
}
.login .sub {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 22px;
}
.login label {
  margin: 0 0 6px;
}
.login input {
  padding: 12px;
}
.login .btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
}
.login .err {
  margin-top: 14px;
}
.login .badge {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
}
