:root {
  --brand:#1ec5c2;
  --brand-dark:#159d9a;
  --accent:#3a4de0;
  --bg:#0f172a;
  --bg-soft:#111f33;
  --card:#ffffff;
  --card-soft:rgba(255,255,255,0.04);
  --text:#0f172a;
  --text-muted:#4b5563;
  --text-on-dark:rgba(255,255,255,0.92);
  --muted-on-dark:rgba(255,255,255,0.72);
  --border:rgba(15,23,42,0.12);
  --border-strong:rgba(15,23,42,0.18);
  --radius-lg:18px;
  --radius-md:12px;
  --radius-sm:8px;
  --shadow-xl:0 40px 80px rgba(15,23,42,0.25);
  --shadow-lg:0 24px 48px rgba(15,23,42,0.18);
  --font: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body.auth-body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at top left, rgba(30,197,194,0.15), rgba(15,23,42,0.9)),
              linear-gradient(135deg, #0f172a, #12213a 45%, #0f172a 90%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 48px);
}

.auth-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 360px);
  width: min(100%, 1100px);
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
}

.auth-wrapper--signup {
  grid-template-columns: minmax(0, 640px) minmax(0, 360px);
}

.auth-form {
  padding: clamp(28px, 5vw, 56px);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 4vw, 28px);
}

.auth-form--wide {
  padding: clamp(32px, 5vw, 64px);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.auth-logo img {
  height: 36px;
  width: auto;
}

.auth-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin: 0;
}

.auth-subhead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.auth-form h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.1;
  color: var(--text);
}

.auth-form h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(12px, 2vw, 18px) 0;
  border-top: 1px solid var(--border);
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.auth-body--signin .form-grid {
  margin-bottom: 16px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-field--full {
  grid-column: 1 / -1;
}

.input-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.label-optional {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.input-field input,
.input-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: var(--font);
  background: #fbfcfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-field input:focus,
.input-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 77, 224, 0.18);
  background: #fff;
}

.input-field input::placeholder,
.input-field textarea::placeholder {
  color: rgba(15, 23, 42, 0.35);
}

.input-field textarea {
  min-height: 120px;
  resize: vertical;
}

.auth-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(58, 77, 224, 0.25);
}

.auth-primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.auth-primary-button--full {
  width: 100%;
  margin-top: 12px;
}

.auth-footer {
  margin: 8px 0 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.form-alert {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.form-alert--error {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #7f1d1d;
}

.form-alert--success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.28);
  color: #14532d;
}

.auth-aside {
  position: relative;
  background: radial-gradient(circle at top right, rgba(30, 197, 194, 0.25), transparent 55%),
              linear-gradient(150deg, rgba(17, 33, 59, 0.95), rgba(12, 21, 37, 0.92));
  color: var(--text-on-dark);
  padding: clamp(32px, 6vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-aside__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 320px;
}

.auth-aside h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 1.9rem);
  line-height: 1.2;
}

.auth-aside p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted-on-dark);
}

.auth-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-on-dark);
}

.auth-highlights li {
  position: relative;
  padding-left: 24px;
}

.auth-highlights li::before {
  content: "⟡";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-size: 0.85rem;
  top: 2px;
}

.auth-aside__footer {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--muted-on-dark);
}

.auth-aside__footer a {
  color: #fff;
  text-decoration: underline;
}

.tenant-step {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tenant-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tenant-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tenant-option:hover,
.tenant-option:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 77, 224, 0.12);
}

.tenant-option input {
  margin-top: 6px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.tenant-option__details {
  flex: 1;
}

.tenant-option__name {
  font-weight: 600;
  color: var(--text);
}

.tenant-option__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.tenant-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.tenant-reset-link {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.tenant-reset-link:hover {
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .auth-wrapper {
    grid-template-columns: minmax(0, 520px);
  }

  .auth-wrapper--signup {
    grid-template-columns: minmax(0, 640px);
  }

  .auth-aside {
    display: none;
  }
}

@media (max-width: 720px) {
  body.auth-body {
    padding: clamp(16px, 4vw, 32px);
  }

  .auth-wrapper,
  .auth-wrapper--signup {
    width: 100%;
    border-radius: var(--radius-md);
  }

  .auth-form {
    padding: clamp(24px, 7vw, 36px);
  }

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

  .auth-primary-button,
  .auth-primary-button--full {
    width: 100%;
    justify-content: center;
  }
}
