/* ==========================================================================
   Jhinai LMS — Auth Forms CSS
   Loaded via the theme's main CSS or the LMS plugin on auth pages.
   ========================================================================== */

/* ── Wrapper ───────────────────────────────────────────────────────────────── */
.ep-auth-page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.ep-auth-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ── Tab switcher ──────────────────────────────────────────────────────────── */
.ep-auth-tabs {
  display: flex;
  background: var(--surface-2, #f6f5ff);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.ep-auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-2, #4A4762);
  text-decoration: none;
  transition: all 0.2s;
}

.ep-auth-tab.is-active {
  background: var(--surface, #fff);
  color: var(--primary, #5B4FE8);
  box-shadow: 0 1px 4px rgba(15,13,26,0.08);
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.ep-auth-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E2E0F0);
  border-radius: 20px;
  padding: 2rem 2.25rem;
  box-shadow: 0 4px 24px rgba(91,79,232,0.08);
}

@media (max-width: 520px) {
  .ep-auth-card { padding: 1.5rem 1.25rem; border-radius: 14px; }
  .ep-auth-page, .ep-auth-wrap { padding: 0.5rem 0.75rem 2rem; }
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.ep-auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.ep-auth-logo {
  margin-bottom: 1.25rem;
}

.ep-auth-logo img {
  height: 40px;
  width: auto;
  margin: 0 auto;
}

.ep-auth-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #0F0D1A);
  margin-bottom: 0.375rem;
}

.ep-auth-subtitle {
  font-size: 0.9375rem;
  color: var(--text-2, #4A4762);
  line-height: 1.5;
}

/* ── Messages ──────────────────────────────────────────────────────────────── */
.ep-auth-messages {
  margin-bottom: 1rem;
}

.ep-auth-messages:empty { display: none; }

.ep-auth-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.ep-auth-message--error {
  background: rgba(239,68,68,0.08);
  color: #DC2626;
  border: 1px solid rgba(239,68,68,0.20);
}

.ep-auth-message--success {
  background: rgba(34,197,94,0.08);
  color: #16A34A;
  border: 1px solid rgba(34,197,94,0.20);
}

.ep-auth-message--info {
  background: rgba(91,79,232,0.06);
  color: var(--primary, #5B4FE8);
  border: 1px solid rgba(91,79,232,0.15);
}

/* ── Form fields ───────────────────────────────────────────────────────────── */
.ep-auth-form .ep-form-group {
  margin-bottom: 1.125rem;
}

.ep-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2, #4A4762);
  margin-bottom: 6px;
}

.ep-form-input {
  width: 100%;
  padding: 0.6875rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text, #0F0D1A);
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #E2E0F0);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.ep-form-input:focus {
  border-color: var(--primary, #5B4FE8);
  box-shadow: 0 0 0 3px rgba(91,79,232,0.12);
}

.ep-form-input.ep-input-error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
}

.ep-form-input::placeholder { color: var(--text-3, #8B88A8); }

/* Input wrap (for password toggle) */
.ep-input-wrap {
  position: relative;
}

.ep-input-wrap .ep-form-input {
  padding-right: 2.75rem;
}

.ep-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3, #8B88A8);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.ep-toggle-pw:hover { color: var(--primary, #5B4FE8); }

/* ── Password strength ─────────────────────────────────────────────────────── */
.ep-pw-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.ep-pw-bar {
  flex: 1;
  height: 4px;
  background: var(--border, #E2E0F0);
  border-radius: 4px;
  overflow: hidden;
}

.ep-pw-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s, background 0.3s;
}

#ep-pw-label {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Checkbox ──────────────────────────────────────────────────────────────── */
.ep-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-2, #4A4762);
  line-height: 1.5;
}

.ep-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border, #E2E0F0);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary, #5B4FE8);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.ep-btn--primary {
  background: var(--primary, #5B4FE8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91,79,232,0.30);
}

.ep-btn--primary:hover {
  background: var(--primary-dark, #3D33CC);
  box-shadow: 0 6px 20px rgba(91,79,232,0.40);
}

.ep-btn--primary:active { transform: scale(0.98); }

.ep-btn--full { width: 100%; }

.ep-btn.is-loading .ep-btn-text { opacity: 0; }
.ep-btn.is-loading { pointer-events: none; }

/* Spinner inside button */
.ep-btn-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ep-spin 0.6s linear infinite;
  display: none;
}

.ep-btn.is-loading .ep-btn-spinner { display: block; }

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

/* ── Links ─────────────────────────────────────────────────────────────────── */
.ep-auth-link {
  color: var(--primary, #5B4FE8);
  font-weight: 500;
  text-decoration: none;
}

.ep-auth-link:hover { text-decoration: underline; }

.ep-auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-2, #4A4762);
  margin-top: 1.25rem;
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */
[data-theme="dark"] .ep-auth-card {
  background: var(--surface-2, #16152B);
  border-color: var(--dark-border, #2D2B50);
}

[data-theme="dark"] .ep-auth-tabs {
  background: var(--surface-3, #1F1E38);
}

[data-theme="dark"] .ep-auth-tab.is-active {
  background: var(--surface-4, #2A2848);
}

[data-theme="dark"] .ep-form-input {
  background: var(--surface-3, #1F1E38);
  color: var(--text, #F0EEFF);
  border-color: var(--dark-border, #2D2B50);
}
