:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233c;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 12%, rgba(116, 145, 255, 0.12), transparent 34rem),
    radial-gradient(ellipse at 90% 90%, rgba(59, 190, 160, 0.1), transparent 30rem),
    #f5f7fb;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(81, 103, 226, 0.28);
  outline-offset: 2px;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(100%, 456px);
  padding: 32px;
  border: 1px solid rgba(220, 226, 238, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(37, 51, 91, 0.11);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  color: #26375c;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #edf0ff;
  color: #4c5ed5;
  font-size: 17px;
  font-weight: 800;
}

.intro {
  margin-bottom: 23px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #69789b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  color: #17233c;
  font-size: clamp(25px, 6vw, 30px);
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.intro-copy {
  margin: 9px 0 0;
  color: #71809c;
  font-size: 14px;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 23px;
  padding: 4px;
  border-radius: 12px;
  background: #f2f4f9;
}

.auth-tab {
  min-height: 39px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7b88a1;
  font-size: 13px;
  font-weight: 700;
}

.auth-tab.is-active {
  background: #fff;
  color: #3448c5;
  box-shadow: 0 2px 6px rgba(36, 48, 85, 0.08);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #34415d;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  background: #fff;
  color: #1d2a44;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input::placeholder {
  color: #a4aec0;
}

.field input:focus,
.field select:focus {
  border-color: #8290ed;
  box-shadow: 0 0 0 3px rgba(91, 109, 225, 0.1);
  outline: none;
}

.field [aria-invalid="true"] {
  border-color: #d84c5b;
  box-shadow: 0 0 0 3px rgba(216, 76, 91, 0.09);
}

.field-hint,
.field-error {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.field-hint {
  color: #8591a8;
}

.field-error {
  color: #bd3547;
}

.field-error:empty {
  display: none;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 750;
  transition: background 140ms ease, transform 140ms ease;
}

.primary-button {
  margin-top: 3px;
  background: #5263d5;
  color: #fff;
  box-shadow: 0 7px 15px rgba(82, 99, 213, 0.18);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #4556c8;
}

.secondary-button {
  width: 100%;
  margin-top: 25px;
  border: 1px solid #dfe4ee;
  background: #fff;
  color: #34415d;
}

.secondary-button:hover:not(:disabled) {
  background: #f7f8fc;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-switch {
  margin: 1px 0 0;
  color: #7b88a1;
  font-size: 12px;
  text-align: center;
}

.text-button {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #4b5dcf;
  font-size: inherit;
  font-weight: 750;
}

.text-button:hover {
  color: #3346bd;
  text-decoration: underline;
}

.loading-view {
  padding: 38px 0;
  color: #71809c;
  font-size: 14px;
  text-align: center;
}

.welcome-view {
  padding: 22px 0 4px;
  text-align: center;
}

.welcome-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin: 0 auto 19px;
  border-radius: 18px;
  background: #e7f7f1;
  color: #21946f;
  font-size: 24px;
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 1;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 36px));
  padding: 14px 17px;
  border: 1px solid #dce3f2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(31, 45, 80, 0.17);
  color: #34415d;
  font-size: 13px;
  line-height: 1.45;
}

.toast[data-kind="error"] {
  border-color: #f0c6cb;
  background: #fff8f8;
  color: #9e2f40;
}

.toast[data-kind="success"] {
  border-color: #bfe6d7;
  background: #f4fcf8;
  color: #176f52;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .page-shell {
    padding: 18px 12px;
  }

  .auth-card {
    padding: 25px 20px;
    border-radius: 18px;
  }
}
