:root {
  --ink: #162033;
  --muted: #637086;
  --line: #dce2ea;
  --blue: #1157d7;
  --blue-dark: #0a3f9f;
  --blue-soft: #eaf1ff;
  --canvas: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.auth-layout {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px);
  align-items: center;
  gap: 70px;
  margin: 0 auto;
  padding: 52px 0;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.auth-intro > p:not(.eyebrow),
.auth-form > div p,
.section-heading p {
  color: var(--muted);
  line-height: 1.65;
}

.account-note {
  display: grid;
  gap: 6px;
  margin-top: 30px;
  padding: 18px;
  border-left: 3px solid var(--blue);
  background: white;
}

.account-note span {
  color: var(--muted);
  line-height: 1.5;
}

.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 34px rgba(25, 39, 69, 0.09);
  overflow: hidden;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.auth-tabs button {
  min-height: 48px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: white;
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.is-active {
  color: var(--blue);
  border-color: var(--blue);
}

.auth-form,
.verification-result {
  display: grid;
  gap: 17px;
  padding: 28px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #3b475c;
  font-weight: 650;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #bfc8d5;
  border-radius: 5px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(17, 87, 215, 0.14);
}

small {
  color: var(--muted);
  font-weight: 450;
}

.check-field {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.check-field a {
  color: var(--blue);
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.button--primary:hover {
  background: var(--blue-dark);
}

.button--secondary {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}

.text-button {
  justify-self: start;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.form-error,
.form-success {
  padding: 10px 12px;
  border-radius: 5px;
}

.form-error {
  color: #8f2118;
  border: 1px solid #f0b7b1;
  background: #fff1ef;
}

.form-success {
  color: #10643c;
  border: 1px solid #9bd4b5;
  background: #effaf4;
}

.portal {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 70px;
}

.portal-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.portal-heading {
  margin-bottom: 24px;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-heading h1 {
  font-size: 38px;
}

.portal-heading p {
  color: var(--muted);
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.account-summary article {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

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

.account-summary strong {
  overflow-wrap: anywhere;
}

.portal-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  overflow: hidden;
}

.section-heading {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading p {
  margin-bottom: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #e8ecf1;
  text-align: left;
}

th {
  color: #536075;
  background: #f8fafc;
  font-size: 12px;
}

.empty-state {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.profile-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.profile-heading h1 {
  margin-bottom: 8px;
  font-size: 38px;
}

.profile-heading p {
  color: var(--muted);
}

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

.profile-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  overflow: hidden;
}

.profile-section > header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.profile-section > header h2,
.profile-section > header p {
  margin-bottom: 0;
}

.profile-section > header p {
  margin-top: 5px;
  color: var(--muted);
}

.profile-details {
  margin: 0;
}

.profile-details > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid #e8ecf1;
}

.profile-details > div:last-child {
  border-bottom: 0;
}

.profile-details dt {
  color: var(--muted);
  font-weight: 650;
}

.profile-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-details a {
  color: var(--blue);
  font-weight: 650;
}

.profile-loading,
.profile-error {
  width: min(680px, calc(100% - 40px));
  margin: 72px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  text-align: center;
}

.profile-loading p,
.profile-error p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 850px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .account-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 540px) {
  .auth-layout,
  .portal,
  .profile-shell {
    width: min(100% - 24px, 1120px);
  }

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

  .auth-form,
  .verification-result {
    padding: 22px 18px;
  }

  .portal-heading,
  .section-heading,
  .profile-heading {
    display: grid;
  }

  .profile-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
