:root {
  --bg-top: #f4e61f;
  --bg-mid: #efe873;
  --bg-bottom: #ecebdc;
  --surface: #fffde7;
  --surface-soft: #f8f3bf;
  --text-main: #111827;
  --text-muted: #3f4b59;
  --navy: #111f3a;
  --navy-strong: #0c1630;
  --accent: #17a3a5;
  --error: #b63131;
  --shadow: 0 16px 36px rgba(22, 28, 40, 0.18);
  --radius-xl: 20px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Space Grotesk", "Segoe UI", "Tahoma", sans-serif;
  color: var(--text-main);
}

.portal-bg,
.admin-bg {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 44%, var(--bg-bottom) 100%);
}

.success-bg,
.error-bg {
  background: linear-gradient(180deg, #f4e61f 0%, #efe98a 48%, #ecebdc 100%);
}

.shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 253, 231, 0.94) 0%, rgba(255, 252, 220, 0.92) 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(17, 31, 58, 0.14);
}

.portal-card {
  width: min(720px, 100%);
  padding: clamp(20px, 5vw, 38px);
}

.brand-head {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}

.logo-wrap {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 31, 58, 0.16);
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-fallback {
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
  padding: 8px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

.lead {
  margin-top: 16px;
  color: var(--text-main);
  font-size: 1.02rem;
  line-height: 1.5;
}

.eyebrow {
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cta-group {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-strong) 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(13, 22, 47, 0.28);
}

.btn-secondary {
  background: #f4efbd;
  color: #17233f;
  border: 1px solid rgba(17, 31, 58, 0.22);
}

.is-disabled,
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.checkbox-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.4;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.hint {
  margin-top: 14px;
  color: #2f3d4d;
  font-size: 0.88rem;
  line-height: 1.5;
}

.params-block {
  margin-top: 18px;
  border-top: 1px solid rgba(17, 31, 58, 0.18);
  padding-top: 12px;
}

.params-block summary {
  cursor: pointer;
  font-weight: 600;
}

.params-block dl {
  margin-top: 10px;
}

.param-line {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 4px 0;
}

.param-line dt {
  font-weight: 600;
  color: #1b2b42;
}

.param-line dd {
  margin: 0;
  color: #2f4761;
  word-break: break-all;
}

.stack {
  display: grid;
  gap: 12px;
}

.policy-text {
  color: #2d4257;
  font-size: 0.9rem;
  line-height: 1.4;
}

.admin-shell {
  max-width: 460px;
  width: 100%;
}

.admin-card {
  padding: 28px;
}

.input-row {
  display: grid;
  gap: 6px;
}

.input-row span {
  font-size: 0.86rem;
  color: #28384f;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(17, 31, 58, 0.3);
  background: #e8e8e8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.96rem;
  color: #111f35;
}

textarea {
  min-height: 92px;
  resize: vertical;
  background: #f3f3f3;
}

.error-msg {
  color: var(--error);
  margin-top: 12px;
}

.admin-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: #0f1d35;
}

.metrics-grid {
  margin-top: 20px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  background: rgba(255, 250, 210, 0.94);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid rgba(17, 31, 58, 0.14);
}

.metric-card h3 {
  font-size: 0.85rem;
  color: #273852;
}

.metric-card p {
  margin-top: 7px;
  font-size: 1.3rem;
  font-weight: 700;
}

.admin-section {
  margin-top: 18px;
  padding: 20px;
}

.settings-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(17, 31, 58, 0.14);
  padding: 10px 8px;
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1f3048;
}

@media (max-width: 640px) {
  .portal-card,
  .admin-card {
    border-radius: 18px;
  }

  .param-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
