/* ============================================================
   ABOODVIDEO Admin UI V2 — Login Page Styles
   Standalone: loaded alongside admin_tokens.css only.
   RTL-first. No base-shell dependencies.
   ============================================================ */

/* ── Reset & base ────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body,
input,
button {
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--text);
}

/* ── Page scaffold ───────────────────────────────────────── */
body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;

  /* Subtle radial vignette so it doesn't look flat */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 10%,
      rgba(6, 182, 212, 0.04) 0%,
      transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 90%,
      rgba(37, 99, 235, 0.05) 0%,
      transparent 70%);
}

/* ── Login page container ────────────────────────────────── */
.login-page {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ── Brand wordmark ──────────────────────────────────────── */
.login-brand {
  position: relative;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  direction: ltr;        /* keep "ABOODVIDEO" always LTR */
  user-select: none;
}

/* Soft cyan glow behind the brand */
.login-brand::before {
  content: "";
  position: absolute;
  inset: -20px -30px;
  background: radial-gradient(ellipse 70% 60% at 50% 50%,
    rgba(6, 182, 212, 0.15) 0%,
    transparent 75%);
  filter: blur(12px);
  pointer-events: none;
  z-index: -1;
}

.brand-accent {
  color: var(--accent); /* cyan-500 */
}

/* ── Subtitle ────────────────────────────────────────────── */
.login-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

/* ── Card ────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* ── Form ────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Input ───────────────────────────────────────────────── */
.login-form .input {
  width: 100%;
  height: var(--input-h);
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-base);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  /* RTL: text aligns to right naturally via dir=rtl on html */
}

.login-form .input::placeholder {
  color: var(--text-muted);
}

.login-form .input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.login-form .input:focus-visible {
  outline: none;
}

/* ── Password wrapper + toggle ───────────────────────────── */
.password-wrap {
  position: relative;
}

/* Extra inline-end padding so text doesn't overlap toggle */
.password-wrap .input {
  padding-inline-start: 40px; /* room for the toggle button (LTR: left; RTL: right) */
}

.password-toggle {
  position: absolute;
  inset-inline-start: 10px;   /* RTL-aware: sits on the "start" side (right in RTL) */
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  line-height: 0;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

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

/* ── Error message ───────────────────────────────────────── */
.login-error {
  padding: 10px 14px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--danger);
  line-height: 1.5;
}

/* ── Buttons (self-contained, no admin_shell.css dependency) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Size: lg */
.btn-lg {
  height: var(--btn-h-lg);
  padding: 0 22px;
  font-size: var(--text-md);
  border-radius: var(--radius-md);
}

/* Modifier: full-width */
.btn-block {
  width: 100%;
}

/* Variant: primary */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:active:not(:disabled) {
  background: var(--primary-active);
  box-shadow: none;
}

/* Loading spinner state (set via JS) */
.btn-primary.is-loading {
  pointer-events: none;
  opacity: 0.75;
  position: relative;
}

.btn-primary.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  margin-inline-start: 6px;
}

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

/* ── Footer note ─────────────────────────────────────────── */
.login-footer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 8px;
}
