@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --ink: #121726;
  --muted: #687184;
  --line: rgba(18, 23, 38, 0.1);
  --navy: #0d1528;
  --navy-soft: #131d34;
  --blue: #1453e5;
  --blue-deep: #0f43ba;
  --teal: #0f7a72;
  --orange: #e77d23;
  --red: #b42318;
  --green: #067647;
  --shadow: 0 22px 50px rgba(11, 20, 38, 0.08);
  --radius-xl: 1.75rem;
  --radius-lg: 1.25rem;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(20, 83, 229, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfbf8 62%, #f5f6fa 100%);
  font-family: Manrope, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(18, 23, 38, 0.06);
}

.site-header__inner,
.portal-wrap,
.site-footer__inner {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #2062fb 0%, var(--blue) 100%);
  color: #fff;
  font-family: Archivo, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 14px 28px rgba(20, 83, 229, 0.28);
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand-copy strong {
  font-family: Archivo, sans-serif;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-copy span:last-child {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.site-nav__link {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.72rem 0.9rem;
  border-radius: 0.8rem;
}

.site-nav__link:hover,
.site-nav__link.is-current {
  color: var(--blue);
  background: rgba(20, 83, 229, 0.08);
}

.header-logout {
  margin-left: 0.35rem;
}

.portal-main {
  padding: 2.5rem 0 4.5rem;
}

.portal-wrap {
  display: grid;
  gap: 1.5rem;
}

.hero-panel,
.page-hero,
.form-card,
.history-section,
.error-panel {
  border: 1px solid rgba(18, 23, 38, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 29rem);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 251, 0.98));
}

.hero-copy {
  padding: 3rem;
  display: grid;
  align-content: center;
  gap: 1.2rem;
}

.hero-copy h1,
.page-hero h1,
.auth-card h2,
.form-card__header h2,
.action-card h2,
.error-panel h1 {
  margin: 0;
  font-family: Archivo, sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.page-hero h1,
.form-card__header h2,
.action-card h2,
.error-panel h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: rgba(255, 255, 255, 0.76);
}

.lede,
.hero-copy p,
.auth-card p,
.form-card__header p,
.action-card p,
.site-footer p,
.support-copy,
.empty-state p,
.history-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.feature-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  font-weight: 700;
}

.feature-list li::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #118980 0%, var(--teal) 100%);
  box-shadow: 0 0 0 0.32rem rgba(15, 122, 114, 0.12);
}

.auth-card {
  background: linear-gradient(180deg, rgba(13, 21, 40, 0.98), rgba(19, 29, 52, 0.98));
  color: #fff;
}

.auth-card__header,
.stack-form {
  padding: 1.5rem 1.6rem;
}

.auth-card__header {
  background: linear-gradient(180deg, rgba(32, 98, 251, 0.28), rgba(20, 83, 229, 0.16));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-card__header p {
  color: rgba(255, 255, 255, 0.84);
}

.stack-form,
.portal-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}

.field-control {
  width: 100%;
  border: 1px solid rgba(18, 23, 38, 0.16);
  border-radius: 0.8rem;
  background: #fff;
  color: var(--ink);
  padding: 0.88rem 0.95rem;
}

.field-control:focus {
  outline: none;
  border-color: rgba(20, 83, 229, 0.54);
  box-shadow: 0 0 0 0.22rem rgba(20, 83, 229, 0.14);
}

.field-control.is-invalid {
  border-color: rgba(180, 35, 24, 0.45);
  box-shadow: 0 0 0 0.22rem rgba(180, 35, 24, 0.1);
}

.field textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.field-error {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.35rem;
  border-radius: 0.8rem;
  border: 1px solid transparent;
  font-size: 0.93rem;
  font-weight: 800;
}

.button--primary {
  color: #fff;
  background: linear-gradient(180deg, #2062fb 0%, var(--blue) 100%);
  box-shadow: 0 14px 28px rgba(20, 83, 229, 0.24);
}

.button--secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: rgba(18, 23, 38, 0.12);
  box-shadow: 0 8px 24px rgba(18, 23, 38, 0.08);
}

.button--small {
  min-height: 2.7rem;
  padding: 0 1rem;
  font-size: 0.84rem;
}

.button--block {
  width: 100%;
}

.alert {
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  border: 1px solid transparent;
  font-weight: 700;
}

.alert--success {
  background: rgba(6, 118, 71, 0.09);
  border-color: rgba(6, 118, 71, 0.18);
  color: var(--green);
}

.alert--info {
  background: rgba(20, 83, 229, 0.09);
  border-color: rgba(20, 83, 229, 0.18);
  color: var(--blue-deep);
}

.alert--error {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.18);
  color: var(--red);
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 251, 0.98));
  padding: 2rem 2.1rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
}

.action-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 251, 0.98));
  border: 1px solid rgba(18, 23, 38, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: grid;
  gap: 0.9rem;
}

.action-card--navy {
  background: linear-gradient(180deg, rgba(13, 21, 40, 0.98), rgba(19, 29, 52, 0.98));
  color: #fff;
}

.action-card--navy p {
  color: rgba(255, 255, 255, 0.78);
}

.action-link {
  color: var(--blue);
  font-weight: 800;
}

.action-card--navy .action-link {
  color: #fff;
}

.form-card {
  background: var(--surface);
}

.form-card__header {
  background: linear-gradient(180deg, #2062fb 0%, var(--blue) 100%);
  color: #fff;
  padding: 1.6rem 1.6rem 1.4rem;
}

.form-card__header p {
  color: rgba(255, 255, 255, 0.88);
}

.portal-form {
  padding: 1.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field--full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.history-section {
  background: var(--surface);
  padding: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 56rem;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 1rem 0.95rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.history-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill--pending {
  background: rgba(231, 125, 35, 0.13);
  color: #9b5a11;
}

.status-pill--synced {
  background: rgba(6, 118, 71, 0.12);
  color: var(--green);
}

.status-pill--failed {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.history-cards {
  display: none;
}

.history-card,
.error-panel {
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}

.history-card__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
}

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding: 2.5rem 0;
}

.site-footer__inner h3 {
  margin: 0 0 0.75rem;
  color: #fff;
  font-family: Archivo, sans-serif;
  font-size: 1rem;
}

@media (width <= 960px) {
  .hero-panel,
  .action-grid,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

@media (width <= 760px) {
  .site-header__inner,
  .page-hero,
  .form-actions,
  .history-card__top {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .history-table {
    display: none;
  }

  .history-cards {
    display: grid;
    gap: 1rem;
  }

  .button {
    width: 100%;
  }
}

@media (width <= 560px) {
  .site-header__inner,
  .portal-wrap,
  .site-footer__inner {
    width: min(calc(100% - 1.2rem), var(--max-width));
  }

  .portal-main {
    padding: 1.4rem 0 3rem;
  }

  .hero-copy,
  .auth-card__header,
  .stack-form,
  .portal-form,
  .page-hero,
  .error-panel {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}