/* Estilos base do PWA. O visual replica as páginas salvas com HTML/CSS puro. */
:root {
  --brand: #343474;
  --brand-soft: #ededf8;
  --accent: #f7d635;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --surface: #ffffff;
  --credential-bg: #d6d4ec;
  --radius: 10px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f8fafc;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

noscript {
  display: block;
  padding: 16px;
  text-align: center;
  background: #fff7ed;
  color: #9a3412;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100dvh;
}

.intro-screen {
  min-height: 100dvh;
  background: #000000;
}

.intro-button {
  display: block;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
  overflow: hidden;
}

.intro-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -6px;
}

.intro-image {
  width: 100%;
  height: 100dvh;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.login-screen {
  display: grid;
  place-items: center;
  padding: max(32px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #f8fafc 0%, #ffffff 48%, rgba(226, 232, 240, 0.55) 100%);
}

.login-card {
  width: min(100%, 520px);
  padding: 28px 24px;
  border: 1px solid #d9e1ec;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-header {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-logo {
  width: 104px;
  height: auto;
}

.login-copy h1 {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
}

.login-copy p,
.login-help {
  margin: 10px auto 0;
  max-width: 360px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field-group {
  display: grid;
  gap: 8px;
  text-align: left;
}

.field-group label {
  color: #1f2937;
  font-size: 14px;
  font-weight: 650;
}

.field-group input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-group input::placeholder {
  color: #94a3b8;
}

.field-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(52, 52, 116, 0.16);
}

.field-group input[aria-invalid="true"] {
  border-color: #dc2626;
}

.field-group small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.4;
}

.primary-button,
.secondary-button,
.certificate-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  width: 100%;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(52, 52, 116, 0.18);
}

.primary-button:active,
.secondary-button:active,
.certificate-link:active {
  transform: translateY(1px);
}

.separator {
  width: 100%;
  height: 1px;
  margin: 24px 0 0;
  background: var(--line);
}

.login-help {
  text-align: center;
  font-size: 12px;
}

.credential-screen {
  overflow-y: auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom));
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.54), rgba(214, 212, 236, 0.12) 38%, rgba(52, 52, 116, 0.08)),
    var(--credential-bg);
}

.credential-wrapper {
  width: min(100%, 350px);
  margin: 0 auto;
}

.credential-heading {
  text-align: center;
}

.credential-heading h1 {
  margin: 0;
  color: #000000;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
}

.student-card {
  padding-top: 16px;
}

.logos-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.logos-row img {
  width: 44%;
  max-height: 50px;
  object-fit: contain;
}

.identity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.photo-frame {
  width: 43%;
  max-width: 148px;
  aspect-ratio: 3 / 4;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-card {
  width: 48%;
  min-width: 132px;
  max-width: 168px;
  padding: 12px;
  border-radius: var(--radius);
  background: #ffffff;
}

.qr-frame {
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.cie-code {
  margin-top: 8px;
  text-align: center;
  color: rgba(0, 0, 0, 0.9);
  font-size: 11px;
  line-height: 1.25;
}

.cie-code p,
.cie-code strong {
  margin: 0;
}

.info-panel {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: #ffffff;
}

.student-info {
  color: rgba(0, 0, 0, 0.92);
  font-size: 11px;
  line-height: 1.28;
}

.student-info p {
  margin: 0;
}

.student-name {
  font-weight: 800;
}

.spacer {
  height: 10px;
}

.year-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

.year-row span {
  color: #2563eb;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.issuer-footer {
  padding-top: 10px;
  text-align: center;
  color: #000000;
}

.issuer-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.issuer-footer small {
  display: block;
  font-size: 10px;
  line-height: 1.3;
}

.certificate-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.certificate-link {
  margin-top: 20px;
  border-radius: 30px;
  background: #ffffff;
  color: #000000;
  font-weight: 500;
}

.certificate-link span {
  color: #16a34a;
  font-weight: 800;
}

.secondary-button {
  margin-top: 14px;
  background: var(--brand);
  color: #ffffff;
}

@media (min-width: 520px) {
  .login-card {
    padding: 32px;
  }

  .credential-screen {
    padding-top: 20px;
  }
}
