/**
 * TBR Login Router — Two-step login form styles.
 *
 * References Elementor global CSS custom properties where available
 * with sensible fallbacks for non-Elementor contexts.
 *
 * @since 1.2.0
 */

/* ── Variables (override via Elementor widget inline styles) ─ */
:root {
  --tbr-lr-primary: var(--e-global-color-primary, #2271b1);
  --tbr-lr-primary-hover: var(--e-global-color-secondary, #135e96);
  --tbr-lr-text: var(--e-global-color-text, #1d2327);
  --tbr-lr-text-secondary: #72777c;
  --tbr-lr-bg: #ffffff;
  --tbr-lr-border: #8c8f94;
  --tbr-lr-border-focus: var(--e-global-color-primary, #2271b1);
  --tbr-lr-radius: 6px;
  --tbr-lr-font: var(
    --e-global-typography-primary-font-family,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen-Sans,
    Ubuntu,
    Cantarell,
    'Helvetica Neue',
    sans-serif
  );
  --tbr-lr-error-bg: #fcf0f1;
  --tbr-lr-error-border: #d63638;
  --tbr-lr-error-text: #d63638;
  --tbr-lr-info-bg: #f0f6fc;
  --tbr-lr-info-border: #72aee6;
  --tbr-lr-info-text: #2271b1;
  --tbr-lr-max-width: 400px;
}

/* ── Container ───────────────────────────────────────────── */
.tbr-lr {
  max-width: var(--tbr-lr-max-width);
  margin: 0 auto;
  font-family: var(--tbr-lr-font);
  color: var(--tbr-lr-text);
  box-sizing: border-box;
}

.tbr-lr *,
.tbr-lr *::before,
.tbr-lr *::after {
  box-sizing: border-box;
}

/* ── Steps ───────────────────────────────────────────────── */
.tbr-lr-step {
  display: none;
  animation: tbr-lr-fade-in 0.25s ease-out;
}

.tbr-lr-step.tbr-lr-active {
  display: block;
}

@keyframes tbr-lr-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Heading ─────────────────────────────────────────────── */
.tbr-lr-heading {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--tbr-lr-text);
  line-height: 1.3;
}

.tbr-lr-subheading {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--tbr-lr-text-secondary);
  line-height: 1.5;
}

/* ── Form Fields ─────────────────────────────────────────── */
.tbr-lr-field {
  margin-bottom: 16px;
}

.tbr-lr-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tbr-lr-text);
}

.tbr-lr-field input[type='email'],
.tbr-lr-field input[type='password'] {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--tbr-lr-text);
  background: var(--tbr-lr-bg);
  border: 1px solid var(--tbr-lr-border);
  border-radius: var(--tbr-lr-radius);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.tbr-lr-field input:focus {
  border-color: var(--tbr-lr-border-focus);
  box-shadow: 0 0 0 1px var(--tbr-lr-border-focus);
  outline: none;
}

.tbr-lr-field input::placeholder {
  color: #a7aaad;
}

/* ── Buttons ─────────────────────────────────────────────── */
.tbr-lr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  border-radius: var(--tbr-lr-radius);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    opacity 0.15s ease;
  text-decoration: none;
}

.tbr-lr-btn-primary {
  color: #ffffff;
  background-color: var(--tbr-lr-primary);
}

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

.tbr-lr-btn-primary:focus-visible {
  outline: 2px solid var(--tbr-lr-primary);
  outline-offset: 2px;
}

.tbr-lr-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

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

/* ── Spinner ─────────────────────────────────────────────── */
.tbr-lr-spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: tbr-lr-spin 0.6s linear infinite;
  flex-shrink: 0;
}

.tbr-lr-loading .tbr-lr-spinner {
  display: inline-block;
}

@keyframes tbr-lr-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Email Display (step 2 header) ───────────────────────── */
.tbr-lr-email-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: var(--tbr-lr-radius);
}

.tbr-lr-email-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--tbr-lr-text);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.tbr-lr-change-email {
  margin-left: 12px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--tbr-lr-primary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tbr-lr-change-email:hover {
  text-decoration: underline;
}

/* ── Messages ────────────────────────────────────────────── */
.tbr-lr-message {
  margin-top: 14px;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  border-radius: var(--tbr-lr-radius);
  display: none;
}

.tbr-lr-message.tbr-lr-msg-error {
  display: block;
  padding: 10px 14px;
  background-color: var(--tbr-lr-error-bg);
  border-left: 4px solid var(--tbr-lr-error-border);
  color: var(--tbr-lr-error-text);
}

.tbr-lr-message.tbr-lr-msg-info {
  display: block;
  padding: 10px 14px;
  background-color: var(--tbr-lr-info-bg);
  border-left: 4px solid var(--tbr-lr-info-border);
  color: var(--tbr-lr-info-text);
}

/* ── Links ───────────────────────────────────────────────── */
.tbr-lr-links {
  margin-top: 16px;
  text-align: center;
}

.tbr-lr-links a {
  font-size: 13px;
  color: var(--tbr-lr-text-secondary);
  text-decoration: none;
}

.tbr-lr-links a:hover {
  color: var(--tbr-lr-primary);
  text-decoration: underline;
}

/* ── Logged-in state ─────────────────────────────────────── */
.tbr-lr-logged-in {
  max-width: var(--tbr-lr-max-width);
  margin: 0 auto;
  text-align: center;
  font-size: 14px;
  color: var(--tbr-lr-text-secondary);
}

.tbr-lr-logged-in a {
  color: var(--tbr-lr-primary);
  text-decoration: none;
}

.tbr-lr-logged-in a:hover {
  text-decoration: underline;
}
