* { box-sizing: border-box; }

:root {
  --navy: #0a2540;
  --blue: #1a73e8;
  --green: #17a36b;
  --green-2: #0fb98a;
  --light: #f4f8fb;
  --text: #1d2730;
  --muted: #5b6b7c;
  --border: #e3ecf3;
  --white: #ffffff;
  --shadow: 0 24px 80px rgba(10, 37, 64, 0.16);
  --shadow-sm: 0 8px 22px rgba(10, 37, 64, 0.08);
  --grad-cta: linear-gradient(135deg, #17a36b 0%, #0fb98a 100%);
  --font-head: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(135deg, #f8fbfd 0%, #eaf4fb 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--navy); letter-spacing: -0.01em; }

.container { width: min(860px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.nav {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
}
.brand-mark {
  width: 36px; height: 36px;
  background: linear-gradient(180deg, #14365a 0%, #0a2540 100%);
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.phone-link { color: var(--blue); font-weight: 700; text-decoration: none; white-space: nowrap; }

.portal-main { flex: 1; padding: 28px 0 60px; }

.portal-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.portal-loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid rgba(23, 163, 107, 0.15);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

label { display: block; margin: 10px 0 6px; color: var(--navy); font-weight: 700; font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--grad-cta);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(23, 163, 107, 0.28);
}
.btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--border); }
.btn[disabled] { background: #cdd6df; color: #fff; box-shadow: none; cursor: not-allowed; transform: none; pointer-events: none; }
.full { width: 100%; }

.error { color: #c0392b; font-weight: 700; font-size: 14px; margin: 8px 0 0; }
.muted { color: var(--muted); font-size: 13px; }

.otp-input {
  letter-spacing: 8px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}
.resend-row { margin-top: 12px; text-align: right; }
.resend-row button {
  border: none; background: transparent; color: var(--blue);
  font-weight: 700; cursor: pointer; padding: 6px 0;
}
.resend-row button[disabled] { color: var(--muted); cursor: not-allowed; }

.portal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.portal-tab {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.portal-tab.active { color: var(--navy); border-bottom-color: var(--green); }

.info-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.info-card h3 { margin: 0 0 6px; font-size: 15px; }
.info-card p { margin: 2px 0; font-size: 14px; }

table.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.history th, table.history td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.history th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
table.history td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.history th.num { text-align: right; }

.check-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; color: var(--navy); }
.check-row input[type="checkbox"] { width: auto; }

.invoice-banner {
  background: #fff7e6;
  border: 1px solid #f0c36d;
  color: #8a5a00;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  margin: 12px 0;
}

.success-banner {
  background: linear-gradient(135deg, rgba(23,163,107,0.12), rgba(15,185,138,0.06));
  border: 1px solid rgba(23,163,107,0.3);
  color: #0f7a4f;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  margin: 12px 0;
}

.site-footer { border-top: 1px solid var(--border); padding: 16px 0; background: var(--white); }
.site-footer .container { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--blue); text-decoration: none; font-weight: 600; }

.save-row { margin-top: 14px; display: flex; gap: 10px; }

@media (max-width: 560px) {
  .portal-panel { padding: 18px 14px; border-radius: 14px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .brand span:last-child { font-size: 13px; }
  table.history { font-size: 13px; }
  table.history th, table.history td { padding: 8px 6px; }
}
