/*
 * villaGo — Auth Pages Styles (Signin / Signup / Reset Password)
 */

.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--y-space-xxl) var(--y-space-m);
}

.auth-card {
  width: 100%;
  max-width: 448px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: var(--y-color-primary);
  border-radius: var(--y-radius-m);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-block-end: var(--y-space-m);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: var(--y-weight-bold);
  text-align: center;
}

.auth-subtitle {
  color: var(--y-color-text-muted);
  font-size: var(--y-font-s);
  text-align: center;
  margin-block: 4px 32px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--y-color-primary-subtle);
  border-radius: var(--y-radius-m);
}

.auth-switch-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--y-radius-s);
  padding: 10px 12px;
  font-weight: var(--y-weight-semibold);
  color: var(--y-color-text);
  transition: all var(--y-transition-fast);
}

.auth-switch-btn.active {
  background: #fff;
  border-color: var(--y-color-border);
  color: var(--y-color-primary);
}

.auth-footer {
  text-align: center;
  margin-block-start: var(--y-space-l);
  color: var(--y-color-text-muted);
  font-size: var(--y-font-s);
}

.auth-footer a {
  color: var(--y-color-primary);
  font-weight: var(--y-weight-semibold);
}

/* ── Auth toasts (Sonner-style top-center, villaGo React Root.tsx) ── */
.villago-auth-toast-host {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(calc(100vw - 32px), 420px);
  pointer-events: none;
  box-sizing: border-box;
}

.villago-auth-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  padding: 14px 12px 14px 16px;
  border-radius: 12px;
  background: var(--y-color-card, #fff);
  color: var(--y-color-text, #2d2a26);
  border: 1px solid var(--y-color-border, rgba(45, 42, 38, 0.1));
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 2px 10px rgba(0, 0, 0, 0.06);
  font-size: var(--y-font-m, 0.9rem);
  line-height: 1.45;
  animation: villagoAuthToastIn 0.38s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.villago-auth-toast--out {
  opacity: 0;
  transform: translateY(-12px);
}

.villago-auth-toast--success {
  border-inline-start: 4px solid #16a34a;
  background: var(--y-color-card, #fff);
  box-shadow:
    0 10px 40px rgba(22, 163, 74, 0.12),
    0 2px 10px rgba(0, 0, 0, 0.06);
}

.villago-auth-toast--error {
  border-inline-start: 4px solid #dc2626;
  background: var(--y-color-card, #fff);
  box-shadow:
    0 10px 40px rgba(220, 38, 38, 0.12),
    0 2px 10px rgba(0, 0, 0, 0.06);
}

.villago-auth-toast--info {
  border-inline-start: 4px solid var(--y-color-primary, #1b6b4a);
  background: var(--y-color-card, #fff);
}

.villago-auth-toast__body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.villago-auth-toast__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.villago-auth-toast--success .villago-auth-toast__icon {
  color: #16a34a;
}

.villago-auth-toast--error .villago-auth-toast__icon {
  color: #dc2626;
}

.villago-auth-toast--info .villago-auth-toast__icon {
  color: var(--y-color-primary, #1b6b4a);
}

.villago-auth-toast__msg {
  word-break: break-word;
}

.villago-auth-toast__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -4px -4px 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--y-color-text-muted, #8a8378);
  border-radius: var(--y-radius-s, 6px);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.villago-auth-toast__close:hover {
  color: var(--y-color-text, #2d2a26);
  background: var(--y-color-secondary, #f5f0e8);
}

@keyframes villagoAuthToastIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .villago-auth-toast {
    animation: none;
  }

  .villago-auth-toast--out {
    transform: none;
  }
}

/* تسجيل الدخول برقم الجوال: خطوة OTP تحت حقل الجوال دون إخفائه */
#villagoOtpStep {
  margin-top: var(--y-space-m);
  padding-top: var(--y-space-m);
  border-top: 1px solid var(--y-color-border);
}

/* Password row + visibility toggle (villago-checkout-password-toggle.js) */
.auth-page .villago-pw-field-line--auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
}

.auth-page .villago-pw-field-line--auth > .villago-pw-field-line__lock {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--y-color-text-muted);
}

.auth-page .villago-pw-field-line--auth > .form-input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-page .villago-pw-field-line--auth > .villago-pw-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--y-color-text-muted);
  cursor: pointer;
  border-radius: var(--y-radius-s);
  transition: color 0.15s ease;
}

.auth-page .villago-pw-field-line--auth > .villago-pw-toggle:hover {
  color: var(--y-color-primary);
}

.auth-page .villago-pw-field-line--auth > .villago-pw-toggle:focus-visible {
  outline: 2px solid var(--y-color-primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE STYLES
   ═══════════════════════════════════════════════════ */

/* ── Large Desktop (lg) ──────────────────────────── */
@media (max-width: 1200px) {}

/* ── Tablet (md) ─────────────────────────────────── */
@media (max-width: 992px) {}

/* ── Mobile Landscape / Large Phone (sm) ─────────── */
@media (max-width: 768px) {
  .auth-page { padding: var(--y-space-xl) var(--y-space-m); min-height: 70vh; }
  .auth-card { padding: var(--y-space-l); }
}

/* ── Small Phone (xs) ────────────────────────────── */
@media (max-width: 480px) {
  .auth-title { font-size: 1.3rem; }
  .auth-card  { padding: var(--y-space-m); }
}
