:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.auth-layout {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 28px;
}

.brand-panel {
  min-height: 520px;
  padding: 52px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 35%),
    linear-gradient(145deg, #172033, #315a9e);
  box-shadow: 0 22px 55px rgba(21, 42, 82, 0.18);
}

.brand-panel h1,
.app-header h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

.brand-panel p {
  max-width: 620px;
  font-size: 1.08rem;
  line-height: 1.7;
}

.security-note {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.2);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.card {
  padding: 28px;
  border: 1px solid #dfe6f1;
  border-radius: 22px;
  background: white;
  box-shadow: 0 12px 35px rgba(20, 39, 73, 0.07);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  justify-self: center;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.muted {
  color: #667085;
  line-height: 1.55;
}

label {
  display: block;
  margin: 19px 0 8px;
  font-weight: 700;
  font-size: 0.93rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  padding: 13px 14px;
  color: #172033;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus,
textarea:focus {
  border-color: #315a9e;
  box-shadow: 0 0 0 4px rgba(49, 90, 158, 0.12);
}

textarea {
  resize: vertical;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.primary,
.secondary,
.danger,
.link-button {
  border: 0;
  border-radius: 11px;
  padding: 12px 16px;
  font-weight: 750;
}

.primary {
  color: white;
  background: #315a9e;
}

.primary:hover {
  background: #284d89;
}

.secondary {
  color: #263a5f;
  border: 1px solid #cfd8e6;
  background: white;
}

.secondary:hover {
  background: #f5f8fc;
}

.danger {
  color: #b42318;
  border: 1px solid #f3b9b5;
  background: #fff4f3;
}

.danger:hover {
  background: #ffe9e7;
}

.full {
  width: 100%;
  margin-top: 22px;
}

.small {
  padding: 9px 12px;
  font-size: .88rem;
}

.link-button {
  width: 100%;
  margin-top: 8px;
  color: #315a9e;
  background: transparent;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.app-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.app-header p {
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(380px, 1.18fr);
  align-items: start;
  gap: 22px;
}

.section-heading,
.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.records-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.record {
  padding: 18px;
  border: 1px solid #e3e9f2;
  border-radius: 16px;
  background: #fbfcfe;
}

.record h3 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.record p {
  margin: 0 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #4c5d78;
  line-height: 1.55;
}

.record footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.record time {
  color: #7d899c;
  font-size: .82rem;
}

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

.account-card,
.recovery-card {
  margin-top: 22px;
}

.recovery-card {
  border-color: #9db7df;
}

.empty-state,
.loading {
  margin-top: 22px;
  padding: 28px;
  border: 1px dashed #cbd5e2;
  border-radius: 14px;
  text-align: center;
  color: #68768c;
  background: #fafcff;
}

.notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
}

.warning {
  color: #7a2e0e;
  border: 1px solid #f3c39e;
  background: #fff5ec;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(420px, calc(100% - 48px));
  padding: 14px 18px;
  border-radius: 12px;
  color: white;
  background: #172033;
  box-shadow: 0 18px 45px rgba(0,0,0,.22);
}

.toast.error {
  background: #b42318;
}

.hidden {
  display: none !important;
}

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

  .brand-panel {
    min-height: 330px;
    padding: 34px;
  }

  .auth-card {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .brand-panel,
  .card {
    border-radius: 18px;
    padding: 22px;
  }

  .app-header,
  .account-card {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header > button,
  .account-card > button {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
  }

  .record footer {
    align-items: stretch;
    flex-direction: column;
  }

  .record-actions {
    width: 100%;
  }

  .record-actions button {
    flex: 1;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }
}
