:root {
  color-scheme: light;
  --bg: #f2f5f8;
  --bg-2: #e8eef5;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --line: #d4dde8;
  --text: #172033;
  --muted: #637286;
  --dim: #8a98ab;
  --brand: #2766b8;
  --green: #187a45;
  --gold: #a36b14;
  --danger: #c24141;
  --warn: #b7791f;
  --shadow: 0 18px 42px rgba(23, 32, 51, 0.12);
  --navy: #101827;
  --navy-2: #142238;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

button,
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
}

button:hover:not(:disabled),
.button:hover {
  border-color: #94b9e8;
  background: #f4f8ff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary,
button.primary,
.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.secondary,
.button.secondary {
  background: transparent;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid #cfdbea;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 125, 240, 0.14);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(194, 65, 65, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.landing-header {
  min-height: 620px;
  background:
    linear-gradient(135deg, rgba(238, 247, 255, 0.98), rgba(248, 251, 255, 0.96) 45%, rgba(233, 244, 236, 0.94)),
    #f6f8fb;
}

.nav,
.app-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.nav-actions,
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-actions a {
  min-height: 38px;
  padding: 8px 14px;
  color: #32465f;
}

.nav-primary {
  border: 1px solid rgba(52, 199, 89, 0.5);
  border-radius: 6px;
  background: rgba(52, 199, 89, 0.12);
}

.hero,
.section,
.dashboard {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.landing-hero {
  padding: 90px 0 120px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.landing-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: 46px;
  line-height: 1.2;
}

.landing-hero p {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.section {
  padding: 78px 0;
}

.section-dark {
  width: 100%;
  max-width: none;
  padding-left: max(20px, calc((100% - 1180px) / 2));
  padding-right: max(20px, calc((100% - 1180px) / 2));
  background: #edf4fb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section h2 {
  margin: 0;
  font-size: 30px;
}

.section-subtitle {
  margin: 10px 0 36px;
  color: var(--muted);
}

.process,
.feature-grid,
.plan-preview,
.plan-explain-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.process {
  grid-template-columns: repeat(4, 1fr);
}

.feature-grid,
.plan-preview,
.plan-explain-grid,
.content-grid {
  grid-template-columns: repeat(2, 1fr);
}

.process article,
.feature-grid article,
.plan-preview article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
}

.process span {
  color: var(--green);
  font-weight: 800;
}

.process h3,
.feature-grid h3,
.plan-preview h3 {
  margin: 8px 0;
}

.process p,
.feature-grid p,
.plan-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.plan-preview strong,
.plan-card .section-kicker {
  color: var(--green);
}

.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(47, 125, 240, 0.12), rgba(52, 199, 89, 0.08)),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 24px;
}

.auth-card h1 {
  margin: 0;
  font-size: 26px;
}

.auth-card p {
  margin: 8px 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-stack label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: #36506f;
  font-size: 13px;
}

.page-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.app-header {
  width: 100%;
  max-width: none;
  padding: 18px max(22px, calc((100% - 1180px) / 2));
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.app-header .brand {
  color: #ffffff;
}

.app-header .brand img {
  width: 46px;
  height: 46px;
}

.app-header-actions span {
  color: #cbd7e8;
  font-size: 13px;
}

.app-header-actions button {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.dashboard {
  padding: 28px 0 48px;
  display: grid;
  gap: 18px;
}

.status-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.status-panel h1,
.panel h2 {
  margin: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
  margin: 0;
}

.status-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
  padding: 12px;
}

.status-grid dt {
  color: var(--dim);
  font-size: 12px;
}

.status-grid dd {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.status-actions {
  display: flex;
  gap: 8px;
}

.plan-card {
  min-height: 260px;
}

.plan-card.featured {
  border-color: rgba(24, 122, 69, 0.35);
}

.plan-card strong {
  display: block;
  margin: 14px 0 10px;
  color: var(--gold);
  font-size: 22px;
}

.plan-card p,
.plan-card li {
  color: var(--muted);
  line-height: 1.7;
}

.plan-card ul {
  margin: 16px 0 0;
  padding-left: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.product-list {
  display: grid;
  gap: 12px;
}

.product-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
  padding: 15px;
}

.product-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.product-main strong {
  display: block;
  margin-bottom: 5px;
}

.product-main small {
  color: var(--muted);
}

.payment-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--navy-2);
  color: #d8e4f2;
  font-size: 13px;
}

td {
  color: #27364a;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf2f8;
  color: #52657c;
  font-size: 12px;
}

.badge.ok {
  background: rgba(24, 122, 69, 0.12);
  color: #187a45;
}

.badge.warn {
  background: rgba(183, 121, 31, 0.12);
  color: #9a5f10;
}

.badge.danger {
  background: rgba(194, 65, 65, 0.12);
  color: #c24141;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-field button {
  white-space: nowrap;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--muted);
  font-size: 13px;
}

.check-row.compact {
  margin-top: -6px;
}

.check-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  flex: 0 0 auto;
}

.field-message {
  min-height: 18px;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-message[data-kind="ok"],
.page-message[data-kind="ok"] {
  color: var(--green);
}

.field-message[data-kind="warn"],
.page-message[data-kind="warn"] {
  color: var(--warn);
}

.field-message[data-kind="error"],
.page-message[data-kind="error"] {
  color: var(--danger);
}

.dashboard-message {
  margin: 0;
}

.auth-page {
  background:
    radial-gradient(circle at top left, rgba(39,102,184,0.16), transparent 34%),
    linear-gradient(135deg, #f2f5f8 0%, #e8eef5 100%);
}

.auth-card,
.panel {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--text);
}

@media (max-width: 900px) {
  .nav,
  .app-header,
  .hero,
  .section,
  .dashboard,
  .footer {
    width: min(100% - 24px, 760px);
  }

  .nav,
  .app-header,
  .status-panel,
  .product-main {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .process,
  .feature-grid,
  .plan-preview,
  .plan-explain-grid,
  .content-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero h1 {
    font-size: 34px;
  }
}

/* Final dark application theme */
:root {
  color-scheme: dark;
  --bg: #090f1a;
  --bg-2: #0d1422;
  --panel: #121a29;
  --panel-2: #162236;
  --line: rgba(255,255,255,0.11);
  --text: #eef4ff;
  --muted: #a8b7cc;
  --dim: #7f91aa;
  --brand: #2c6fc9;
  --green: #62d394;
  --gold: #e2b65f;
  --danger: #f08a8a;
  --warn: #e5a84d;
  --shadow: 0 20px 52px rgba(0,0,0,0.28);
  --navy: #080d17;
  --navy-2: #111b2c;
}

body,
.auth-page {
  background: var(--bg);
  color: var(--text);
}

.auth-page {
  background:
    radial-gradient(circle at top left, rgba(44,111,201,0.18), transparent 36%),
    linear-gradient(135deg, #090f1a 0%, #0d1422 100%);
}

button,
.button,
input {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

input::placeholder {
  color: var(--dim);
}

button:hover:not(:disabled),
.button:hover {
  border-color: rgba(120,183,255,0.45);
  background: #1a2940;
}

.primary,
button.primary,
.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.auth-card,
.panel,
.process article,
.feature-grid article,
.plan-preview article,
.product-row,
.status-grid div {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: none;
}

.app-header,
.landing-header {
  background: var(--navy);
}

.section-dark {
  background: var(--bg-2);
  border-color: var(--line);
}

.footer {
  border-color: var(--line);
}

.auth-links,
.nav-actions a {
  color: var(--muted);
}

.badge {
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}

.status-grid div,
.product-row {
  background: var(--panel-2);
}
