.auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 16%, rgb(8 125 245 / 8%), transparent 28rem),
    radial-gradient(circle at 88% 82%, rgb(8 125 245 / 4%), transparent 24rem),
    linear-gradient(145deg, #f9fcff 0%, #f4f9fe 48%, #f8fbfe 100%);
}

.auth-shell[hidden],
.dashboard[hidden] {
  display: none;
}

.auth-view {
  min-height: 100vh;
}

.auth-page {
  display: grid;
  width: 100%;
  min-height: 100vh;
  padding: 3rem clamp(2rem, 5vw, 5rem);
  animation: view-enter 240ms var(--ease-out) both;
  grid-template-rows: auto 1fr auto;
}

.auth-brand {
  display: inline-flex;
  width: fit-content;
  flex-direction: column;
  gap: 0.48rem;
}

.auth-brand span {
  color: var(--color-blue);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-brand strong {
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.auth-panel {
  width: min(100%, 34rem);
  align-self: center;
  justify-self: center;
  margin: 2.5rem 0;
  padding: clamp(2.4rem, 4vw, 3.3rem);
  border: 1px solid rgb(204 217 230 / 84%);
  border-radius: 1.15rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 2rem 5rem -3.2rem rgb(35 84 130 / 42%), 0 2px 6px rgb(24 58 91 / 4%);
  backdrop-filter: blur(16px);
}

.auth-panel--wide {
  width: min(100%, 37rem);
}

.auth-panel-header {
  margin-bottom: 2rem;
}

.auth-panel-header p {
  margin-bottom: 0.55rem;
  color: var(--color-blue);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-panel-header h1 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.85rem;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.auth-panel-header span {
  display: block;
  margin-top: 0.65rem;
  color: var(--color-muted);
  font-size: 0.79rem;
  line-height: 1.6;
}

.auth-development-note {
  display: grid;
  margin: -0.45rem 0 1.45rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #cce3fa;
  border-left: 3px solid var(--color-blue);
  border-radius: 0.65rem;
  background: var(--color-blue-faint);
  gap: 0.3rem;
}

.auth-development-note strong {
  color: var(--color-blue);
  font-size: 0.7rem;
  font-weight: 700;
}

.auth-development-note p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 1.25rem;
}

.auth-field {
  display: grid;
  color: var(--color-text-soft);
  font-size: 0.74rem;
  font-weight: 620;
  gap: 0.55rem;
}

.auth-field > input,
.auth-password-control {
  width: 100%;
  min-height: 3.45rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 0.7rem;
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-field > input,
.auth-password-control input {
  min-width: 0;
  padding: 0 1rem;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
}

.auth-field > input {
  outline: 1px solid transparent;
}

.auth-field > input:focus,
.auth-password-control:focus-within {
  border-color: #8bc2f9;
  box-shadow: 0 0 0 3px rgb(8 125 245 / 9%);
}

.auth-password-control {
  display: flex;
  align-items: stretch;
}

.auth-password-control input {
  flex: 1;
  border: 0;
}

.auth-password-control button {
  padding: 0 1rem;
  background: transparent;
  color: var(--color-blue);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 650;
}

.auth-role-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-role-field legend {
  margin-bottom: 0.55rem;
  color: var(--color-text-soft);
  font-size: 0.74rem;
  font-weight: 620;
}

.auth-role-options {
  display: grid;
  padding: 0.22rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 0.7rem;
  background: #f5f8fb;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
}

.auth-role-options label {
  position: relative;
  min-width: 0;
}

.auth-role-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-role-options span {
  display: grid;
  min-height: 3rem;
  place-items: center;
  border-radius: 0.5rem;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 620;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.auth-role-options input:checked + span {
  background: var(--color-surface);
  box-shadow: var(--shadow-tab);
  color: var(--color-blue);
}

.auth-role-options input:focus-visible + span {
  outline: 3px solid rgb(8 125 245 / 24%);
  outline-offset: 1px;
}

.auth-primary-button {
  display: inline-flex;
  min-height: 3.45rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  padding: 0 1.25rem;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #1285f8 0%, #0878eb 100%);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 680;
  box-shadow: 0 0.75rem 1.5rem -1rem rgb(8 125 245 / 78%);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.auth-primary-button:hover:not(:disabled) {
  box-shadow: 0 1rem 1.8rem -1rem rgb(8 125 245 / 88%);
  transform: translateY(-1px);
}

.auth-primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-message,
.auth-notice {
  margin: 0;
  padding: 0.78rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.72rem;
  line-height: 1.5;
}

.auth-message {
  border: 1px solid #f0cece;
  background: #fff6f6;
  color: var(--color-error);
}

.auth-notice {
  margin-bottom: 1.2rem;
  border: 1px solid #c9e6d8;
  background: #f2fbf7;
  color: #2d7658;
}

.auth-switch-copy {
  margin-top: 1.7rem;
  color: var(--color-muted);
  font-size: 0.74rem;
  text-align: center;
}

.auth-switch-copy a {
  color: var(--color-blue);
  font-weight: 650;
}

.auth-form-links {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.35rem;
}

.auth-form-links a,
.auth-helper-copy {
  color: var(--color-muted);
  font-size: 0.7rem;
}

.auth-form-links a {
  color: var(--color-blue);
  font-weight: 650;
}

.auth-demo-access {
  justify-self: center;
  width: min(100%, 34rem);
  padding: 0.75rem 0.9rem;
  border: 1px solid rgb(204 217 230 / 74%);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 72%);
  color: var(--color-muted);
  font-size: 0.66rem;
}

.auth-demo-access summary { cursor: pointer; color: var(--color-text-soft); font-weight: 650; text-align: center; }
.auth-demo-access summary:focus-visible { outline: 3px solid rgb(8 125 245 / 20%); outline-offset: 0.25rem; border-radius: 0.2rem; }

.auth-demo-access .auth-demo-intro {
  margin: 0.8rem 0 0;
  line-height: 1.5;
  text-align: center;
}

.auth-demo-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.75rem;
  gap: 0.55rem;
}

.auth-demo-option {
  display: grid;
  min-width: 0;
  min-height: 4.15rem;
  align-content: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 0.65rem;
  background: rgb(255 255 255 / 86%);
  color: var(--color-muted);
  cursor: pointer;
  gap: 0.2rem;
  text-align: left;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.auth-demo-option strong {
  color: var(--color-text-soft);
  font-size: 0.73rem;
  font-weight: 680;
}

.auth-demo-option:hover {
  border-color: #9ac9f8;
  background: #f8fbff;
  transform: translateY(-1px);
}

.auth-demo-option:focus-visible {
  outline: 3px solid rgb(8 125 245 / 20%);
  outline-offset: 1px;
}

.auth-demo-option[aria-pressed="true"] {
  border-color: #69adf3;
  background: #f1f8ff;
  box-shadow: inset 0 0 0 1px rgb(8 125 245 / 8%);
}

.auth-demo-option[aria-pressed="true"] strong {
  color: var(--color-blue);
}

.auth-demo-access .auth-demo-status {
  min-height: 1rem;
  margin: 0.65rem 0 0;
  color: #2d7658;
  font-weight: 620;
  line-height: 1.5;
  text-align: center;
}

.auth-demo-access .auth-demo-note {
  margin: 0.4rem 0 0;
  line-height: 1.5;
  text-align: center;
}

.auth-recovery-success {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--space-4);
}

.auth-recovery-success > i { width: 3rem; height: 3rem; color: #278159; }
.auth-recovery-success h2 { margin: 0; color: var(--color-text); }
.auth-recovery-success p { margin: 0; color: var(--color-muted); line-height: 1.65; }
.auth-recovery-success .auth-primary-button { width: 100%; }

@media (max-width: 36rem) {
  .auth-page {
    padding: 2rem 1.25rem;
  }

  .auth-panel {
    margin: 2rem 0;
    padding: 2rem 1.5rem;
  }

  .auth-demo-access {
    border-radius: 0.7rem;
  }

  .auth-demo-options {
    grid-template-columns: 1fr;
  }
}
