/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; }
body { min-height: 100%; display: flex; background: #fff; }

/* ── Layout ────────────────────────────────────────────────── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  min-height: 100vh;
  position: relative;
}

.auth-card {
  width: calc(100% - 36px);
  max-width: 400px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vh, 18px);
}

.auth-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #333;
  margin-bottom: clamp(24px, 5vh, 36px);
}

.auth-desc {
  font-size: 10.5px;
  color: #666;
  line-height: 1.5;
}

/* ── Welcome / settings nav links ──────────────────────────── */
.welcome-greeting { margin-bottom: 18px; }
.welcome-nav { text-align: center; font-size: 10.5px; color: #666; }
.welcome-nav a { color: #2689ff; text-decoration: none; }
.welcome-nav a:hover { text-decoration: underline; }

/* ── Messages ──────────────────────────────────────────────── */
.msg {
  padding: 12px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 500;
}
.msg--error { background: #ffebee; color: #c62828; }
.msg--info, .msg--success { background: #e8f5e9; color: #2e7d32; }

/* ── Form ──────────────────────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vh, 18px);
}

.group {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vh, 18px);
}
.group--oidc { gap: 9px; }
.group--fields { gap: 18px; }

/* ── Fields ────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
}

.field__label {
  font-size: 10.5px;
  font-weight: 600;
  color: #333;
  margin-bottom: 9px;
  line-height: 1;
}

.field__input {
  height: clamp(32px, 6vh, 36px);
  padding: 0 9px;
  background: #f3f3f3;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10.5px;
  color: #333;
  outline: none;
  transition: border-color 0.2s ease;
}
.field__input::placeholder { color: rgba(51, 51, 51, 0.5); }
.field__input:focus { border-color: #2689ff; }
.field__input--err { border-color: #c62828; }
.field__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #f3f3f3 inset;
  -webkit-text-fill-color: #333;
  transition: background-color 5000s ease-in-out 0s;
}
.field__error { font-size: 9px; color: #c62828; margin-top: 4px; }

.field__pw {
  position: relative;
  display: flex;
}
.field__pw .field__input {
  flex: 1;
  padding-right: 36px;
}
.field__eye {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  opacity: 0.7;
  padding: 0;
  display: flex;
  align-items: center;
}
.field__eye:hover { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  height: clamp(32px, 6vh, 36px);
  width: 100%;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  text-decoration: none;
}
.btn:disabled { background: #a1a1a2; color: #fff; cursor: not-allowed; }
.btn--primary { background: #2689ff; color: #fff; }
.btn--primary:hover:not(:disabled) { background: #1e7de8; }
.btn--secondary { background: #f3f3f3; color: #333; }
.btn--secondary:hover:not(:disabled) { background: #e8e8e8; }
.btn--social { background: #f3f3f3; color: #333; text-align: center; gap: 8px; }
.btn--social:hover:not(:disabled) { background: #e8e8e8; }
.btn__icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Submit button spacing within field groups ─────────────── */
.group--fields > .btn { margin-top: 9px; }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}
.divider span { font-size: 10.5px; color: #999; }

/* ── Links ─────────────────────────────────────────────────── */
.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding-top: 6px;
}
.auth-link {
  font-size: 10.5px;
  font-weight: 600;
  color: #2689ff;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-link-line { font-size: 10.5px; color: #333; }

/* ── OTP cells ─────────────────────────────────────────────── */
.otp-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}
.otp-cells {
  display: flex;
  gap: 8px;
}
.otp-cell {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #f3f3f3;
  text-align: center;
  font-size: 10.5px;
  font-weight: 500;
  color: #333;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.otp-cell:focus { border-color: #2689ff; }
.otp-cell--success {
  background: rgba(80, 167, 100, 0.15);
  border-color: #50a764;
  color: #50a764;
}
.otp-cell--error {
  background: rgba(245, 128, 128, 0.2);
  border-color: #f58080;
  color: #f58080;
}

/* ── Label row with inline link ────────────────────────────── */
.field__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.field__label-row .field__label {
  margin-bottom: 0;
}
.field__forgot-link {
  font-size: 10.5px;
  font-weight: 500;
  color: #2689ff;
  text-decoration: none;
}

/* ── Field row (side-by-side) ──────────────────────────────── */
.field-row {
  display: flex;
  gap: 17px;
}
.field--half { flex: 1; min-width: 0; }

/* ── Custom dropdown ───────────────────────────────────────── */
.dropdown {
  position: relative;
}
.dropdown__trigger {
  width: 100%;
  height: clamp(32px, 6vh, 36px);
  background: #f3f3f3;
  border-radius: 9px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 500;
  color: #333;
  transition: border-color 0.2s ease;
}
.dropdown--open .dropdown__trigger {
  border-color: #2689ff;
}
.dropdown__value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown__value:empty::before {
  content: attr(data-placeholder);
  opacity: 0.5;
}
.dropdown__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.dropdown--open .dropdown__chevron {
  transform: rotate(180deg);
}
.dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #f3f3f3;
  border-radius: 15px;
  box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.05);
  z-index: 50;
  padding: 6px;
  flex-direction: column;
  gap: 2px;
}
.dropdown--open .dropdown__menu {
  display: flex;
}
.dropdown__option {
  width: 100%;
  text-align: left;
  padding: 0 12px;
  height: 33px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-size: 10.5px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.15s ease;
}
.dropdown__option:hover { background: #f9f9f9; }
.dropdown__option--active { background: #f3f3f3; }

/* ── Select wrapper ────────────────────────────────────────── */
.field__select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field__select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  cursor: pointer;
  width: 100%;
}
.field__chevron {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ── Description centered ──────────────────────────────────── */
.auth-desc--center {
  text-align: center;
  margin-bottom: 18px;
}

/* ── Logo ──────────────────────────────────────────────────── */
.auth-logo {
  position: absolute;
  top: 18px;
  left: 54.5px;
  transform: translateX(-50%);
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-logo:hover { opacity: 0.8; }
.auth-logo img { width: 73px; height: 19px; display: block; }

/* ── Copyright ─────────────────────────────────────────────── */
.auth-copyright {
  position: absolute;
  bottom: 18px;
  left: 18px;
  font-size: 10.5px;
  font-weight: 600;
  color: #333;
}

/* ── Settings sections ─────────────────────────────────────── */
.settings-sections-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Consent ───────────────────────────────────────────────── */
.consent-scopes {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.consent-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  cursor: pointer;
}
.consent-actions {
  display: flex;
  gap: 12px;
}
.consent-actions .btn { flex: 1; }
