:root {
  --font-sans: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --color-bg: #f8fafc;
  --color-panel: #f1f5f9;
  --color-surface: #ffffff;
  --color-surface-muted: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-border-focus: #94a3b8;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
  --color-primary: #0f172a;
  --color-primary-hover: #1e293b;
  --color-primary-active: #334155;
  --color-primary-soft: #f1f5f9;
  --color-success: #059669;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-panel: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 520px);
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 28px;
}

.auth-brand-panel,
.auth-main-panel {
  min-height: 0;
}

.auth-brand-panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  color: #f8fbff;
  border: 1px solid rgba(203, 213, 225, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  position: relative;
  align-self: center;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.12);
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
}

.auth-brand-top {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth-brand-mark {
  width: 56px;
  height: 56px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-soft);
}

.auth-brand-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: rgba(241, 245, 249, 0.92);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-brand-copy h1 {
  font-size: clamp(26px, 2.8vw, 32px);
  line-height: 1.18;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0;
}

.auth-brand-copy p {
  max-width: 28rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 14px;
  line-height: 1.5;
}

.auth-brand-meta {
  display: grid;
  gap: 14px;
}

.auth-meta-row {
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(203, 213, 225, 0.14);
}

.auth-meta-label {
  color: rgba(191, 219, 254, 0.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-meta-value {
  color: rgba(248, 250, 252, 0.96);
  font-size: 14px;
  line-height: 1.6;
}

.auth-main-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-surface {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(199, 210, 224, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.auth-surface-bar {
  height: 6px;
  background: linear-gradient(90deg, #0f172a 0%, #334155 100%);
}

.auth-surface-body {
  padding: 30px;
}

.auth-card-header {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-card-title {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0;
}

.auth-card-subtitle {
  max-width: 34rem;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

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

.form-group {
  display: grid;
  gap: 8px;
}

.password-field {
  position: relative;
}

label {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.password-field input {
  padding-right: 48px;
}

input:hover {
  border-color: var(--color-border-strong);
}

input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.2);
}

input::placeholder {
  color: var(--color-text-tertiary);
}

.field-error {
  color: var(--color-danger);
  font-size: 12px;
  line-height: 1.5;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.password-toggle:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.password-toggle .icon-hidden {
  display: none;
}

.password-toggle.is-visible .icon-visible {
  display: none;
}

.password-toggle.is-visible .icon-hidden {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-primary:active {
  background: var(--color-primary-active);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.alert-success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.alert-error {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.auth-inline-link {
  justify-self: start;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.auth-inline-link:hover {
  color: var(--color-primary-hover);
}

.auth-provider-section {
  display: grid;
  gap: 12px;
}

.btn-provider {
  font-weight: 700;
}

.auth-support-text {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.auth-support-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.divider {
  height: 1px;
  margin: 6px 0 2px;
  background: linear-gradient(90deg, transparent 0%, var(--color-border) 15%, var(--color-border) 85%, transparent 100%);
}

.divider-labeled {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 0;
}

.divider-labeled span {
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.consent-app {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.consent-scopes {
  list-style: none;
  display: grid;
  gap: 10px;
}

.consent-scopes li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
}

.consent-scopes li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #334155;
  flex-shrink: 0;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.state-panel {
  display: grid;
  gap: 18px;
}

.state-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
}

.state-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--color-danger);
}

.state-actions {
  display: grid;
  gap: 12px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-secondary);
}

.text-small {
  font-size: 13px;
}

.stack-sm {
  display: grid;
  gap: 10px;
}

.stack-md {
  display: grid;
  gap: 16px;
}

.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

.mb-md {
  margin-bottom: 16px;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .auth-brand-panel,
  .auth-main-panel {
    min-height: auto;
  }

  .auth-brand-panel {
    align-self: stretch;
  }

  .auth-brand-content,
  .auth-surface-body {
    padding: 28px;
  }

  .auth-brand-copy h1 {
    font-size: 28px;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    padding: 0;
    gap: 0;
  }

  .auth-brand-panel,
  .auth-surface {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .auth-brand-content,
  .auth-surface-body {
    padding: 24px 20px;
  }

  .auth-card-title {
    font-size: 22px;
  }

  .consent-actions {
    grid-template-columns: 1fr;
  }
}
