/* immoAI.guru — Login page + post-login auth success */

/* ── Standalone auth-success.html page ── */
body.auth-success-v4 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-soft, linear-gradient(165deg, #f8fafd 0%, #eef2fa 45%, #f5f7fc 100%));
  color: var(--text, #1e293b);
}

body.auth-success-v4 .auth-success-page {
  width: 100%;
  max-width: 400px;
}

body.auth-success-v4 .auth-success-card {
  width: 100%;
  padding: 40px 32px 36px;
  text-align: center;
  background: var(--surface-glass, rgba(255, 255, 255, 0.95));
  border: 1px solid var(--border, rgba(180, 200, 235, 0.5));
  border-radius: 22px;
  box-shadow: var(--shadow-lg, 0 16px 48px rgba(15, 23, 42, 0.12));
}

body.auth-success-v4 .auth-success-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: color-mix(in srgb, #22c55e 14%, var(--surface, #fff));
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

body.auth-success-v4 .auth-success-card__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #1e293b);
}

body.auth-success-v4 .auth-success-card__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
}

body.auth-success-v4 .auth-success-card__loader {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 3px solid var(--border, #e2e8f0);
  border-top-color: var(--accent, #5271d8);
  border-radius: 50%;
  animation: auth-success-spin 0.8s linear infinite;
}

body.auth-success-v4 .modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--modal-overlay, rgba(15, 23, 42, 0.45));
}

body.auth-success-v4 .modal-overlay.show {
  display: flex;
}

body.auth-success-v4 .modal-content {
  max-width: 480px;
}

body.auth-success-v4 .modal-header--copilot {
  padding: 24px 28px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #5271d8) 0%, var(--accent-hover, #425fbf) 100%);
  border-bottom: none;
  /* Override regula globală app-v4 .modal-header (display:flex row + align center)
     care punea iconul + cele 3 texte pe 3 coloane orizontale. Pe varianta copilot
     vrem stivă verticală centrată. */
  flex-direction: column !important;
  align-items: center !important;
  gap: 0 !important;
}

body.auth-success-v4 .modal-header--copilot h3 {
  margin: 0;
  font-size: 22px;
  color: #fff;
}

body.auth-success-v4 .modal-header--copilot p {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
}

body.auth-success-v4 .channel-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.auth-success-v4 .channel-btn .radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
}

body.auth-success-v4 .channel-btn .radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s;
}

body.auth-success-v4 .channel-btn.active .radio::after {
  transform: translate(-50%, -50%) scale(1);
}

body.auth-success-v4 .channel-btn-wa {
  border: 2px solid #25D366;
  background: var(--surface, #fff);
  color: #25D366;
}

body.auth-success-v4 .channel-btn-wa.active {
  background: #25D366;
  color: #fff;
}

body.auth-success-v4 .channel-btn-tg {
  border: 2px solid #0088cc;
  background: var(--surface, #fff);
  color: #0088cc;
}

body.auth-success-v4 .channel-btn-tg.active {
  background: #0088cc;
  color: #fff;
}

body.auth-success-v4 .otp-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border, #cbd5e1);
  border-radius: 8px;
  font-size: 28px;
  text-align: center;
  letter-spacing: 12px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  box-sizing: border-box;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
}

body.auth-success-v4 .submit-btn {
  padding: 12px 36px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

body.auth-success-v4 .submit-btn.submit-btn-tg {
  background: linear-gradient(135deg, var(--accent, #5271d8), var(--accent-hover, #425fbf));
}

body.auth-success-v4 .submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.auth-success-v4 .link-btn {
  background: none;
  border: none;
  color: var(--accent, #5271d8);
  font-size: 13px;
  cursor: pointer;
}

body.auth-success-v4 .err-msg {
  color: #dc2626;
  font-size: 13px;
  margin-top: 10px;
}

body.auth-success-v4 .attempts-badge {
  font-size: 11px;
  color: var(--text-dim, #94a3b8);
  background: var(--surface-elevated, #f1f5f9);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

html[data-theme="dark"] body.auth-success-v4 {
  background: var(--bg-soft) !important;
  color: var(--text);
}

html[data-theme="dark"] body.auth-success-v4 .auth-success-card {
  background: var(--surface-glass) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}

html[data-theme="dark"] body.auth-success-v4 .auth-success-card__icon {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

html[data-theme="dark"] body.auth-success-v4 .auth-success-card__title {
  color: var(--text) !important;
}

html[data-theme="dark"] body.auth-success-v4 .auth-success-card__subtitle {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] body.auth-success-v4 .channel-btn-wa,
html[data-theme="dark"] body.auth-success-v4 .channel-btn-tg {
  background: var(--surface-elevated) !important;
}

html[data-theme="dark"] body.auth-success-v4 .otp-input {
  background: var(--surface-elevated) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* ── Login shell (token-based) ── */
body.login-v4 {
  background: var(--bg-soft, linear-gradient(165deg, #f8fafd 0%, #eef2fa 45%, #f5f7fc 100%));
  color: var(--text, #1e293b);
}

body.login-v4 .container {
  background: var(--surface-glass, rgba(255, 255, 255, 0.92));
  border: 1px solid var(--border, rgba(180, 200, 235, 0.6));
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(15, 23, 42, 0.08));
}

body.login-v4 .logo h1 {
  color: var(--accent, #5271d8);
}

body.login-v4 .logo p,
body.login-v4 #subtitle-text,
body.login-v4 label,
body.login-v4 .country-option span {
  color: var(--text-muted, #64748b);
}

body.login-v4 #form-title,
body.login-v4 h2 {
  color: var(--text, #1e293b);
}

body.login-v4 input,
body.login-v4 select {
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
  border: 1px solid var(--border, #e2e8f0);
}

body.login-v4 input:focus,
body.login-v4 select:focus {
  border-color: var(--accent, #5271d8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #5271d8) 15%, transparent);
}

body.login-v4 .language-btn {
  background: var(--surface, #fff);
  border-color: var(--border, #e2e8f0);
  color: var(--text-muted, #64748b);
}

body.login-v4 .language-dropdown {
  background: var(--surface, #fff);
  border-color: var(--border, #e2e8f0);
  box-shadow: var(--shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.1));
}

body.login-v4 .language-option {
  color: var(--text, #1e293b);
}

body.login-v4 .language-option:hover {
  background: var(--accent-soft, #f5f5f5);
}

body.login-v4 .login-theme-toggle {
  background: var(--surface, #fff);
  border-color: var(--border, #e2e8f0);
  color: var(--text-muted, #64748b);
}

body.login-v4 .login-theme-toggle:hover {
  background: var(--accent-soft, rgba(82, 113, 216, 0.08));
  color: var(--accent, #5271d8);
}

body.login-v4 .tabs {
  border-bottom-color: var(--border, #f0f0f0);
}

body.login-v4 .tab {
  color: var(--text-muted, #666);
}

body.login-v4 .tab.active {
  color: var(--accent, #5271d8);
}

body.login-v4 .btn-primary {
  background: linear-gradient(135deg, var(--accent, #5271d8) 0%, var(--accent-hover, #425fbf) 100%);
}

body.login-v4 .btn-google {
  background: var(--surface, #fff);
  color: var(--text, #333);
  border-color: var(--border, #e0e0e0);
}

body.login-v4 .btn-google:hover {
  border-color: var(--accent, #5271d8);
  background: var(--accent-soft, #fff);
}

body.login-v4 .divider::before {
  background: var(--border, #e0e0e0);
}

body.login-v4 .divider span {
  background: var(--surface-glass, #fff);
  color: var(--text-dim, #999);
}

body.login-v4 .message.error {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

body.login-v4 .message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.25);
}

body.login-v4 .password-requirements {
  background: var(--surface-elevated, #f9f9f9);
  color: var(--text-muted, #64748b);
}

body.login-v4 a[style*="color: #5271d8"],
body.login-v4 #toggle-link,
body.login-v4 #forgot-password-link a,
body.login-v4 #terms-link,
body.login-v4 #gdpr-link {
  color: var(--accent, #5271d8) !important;
}

body.login-v4 [style*="border-top: 1px solid #e0e0e0"] {
  border-top-color: var(--border, #e0e0e0) !important;
}

body.login-v4 [style*="color: #666"] {
  color: var(--text-muted, #666) !important;
}

body.login-v4 #loadingOverlay {
  background: color-mix(in srgb, var(--accent, #5271d8) 92%, #0f1419);
}

/* ── Auth success backdrop (post-login) ── */
body.app-v4 .auth-success-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-soft, linear-gradient(165deg, #f8fafd 0%, #eef2fa 45%, #f5f7fc 100%));
}

body.app-v4 .auth-success-backdrop.is-visible {
  display: flex;
}

body.app-v4 .auth-success-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px 36px;
  text-align: center;
  background: var(--surface-glass, rgba(255, 255, 255, 0.95));
  border: 1px solid var(--border, rgba(180, 200, 235, 0.5));
  border-radius: 22px;
  box-shadow: var(--shadow-lg, 0 16px 48px rgba(15, 23, 42, 0.12));
}

body.app-v4 .auth-success-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: color-mix(in srgb, #22c55e 14%, var(--surface, #fff));
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

body.app-v4 .auth-success-card__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #1e293b);
}

body.app-v4 .auth-success-card__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
}

body.app-v4 .auth-success-card__loader {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 3px solid var(--border, #e2e8f0);
  border-top-color: var(--accent, #5271d8);
  border-radius: 50%;
  animation: auth-success-spin 0.8s linear infinite;
}

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

/* ── Dark theme ── */
html[data-theme="dark"] body.login-v4 {
  background: var(--bg-soft) !important;
  color: var(--text);
}

html[data-theme="dark"] body.login-v4 .container {
  background: var(--surface-glass) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}

html[data-theme="dark"] body.login-v4 input,
html[data-theme="dark"] body.login-v4 select {
  background: var(--surface-elevated) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] body.login-v4 .language-btn,
html[data-theme="dark"] body.login-v4 .language-dropdown,
html[data-theme="dark"] body.login-v4 .login-theme-toggle {
  background: var(--surface-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}

html[data-theme="dark"] body.login-v4 .language-option:hover {
  background: var(--accent-soft) !important;
}

html[data-theme="dark"] body.login-v4 .btn-google {
  background: var(--surface-elevated) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] body.login-v4 .divider span {
  background: var(--surface) !important;
  color: var(--text-dim) !important;
}

html[data-theme="dark"] body.login-v4 .password-requirements {
  background: var(--surface-elevated) !important;
}

html[data-theme="dark"] body.login-v4 .message.error {
  background: rgba(127, 29, 29, 0.35) !important;
  color: #fecaca !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

html[data-theme="dark"] body.login-v4 .message.success {
  background: rgba(22, 101, 52, 0.35) !important;
  color: #bbf7d0 !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}

html[data-theme="dark"] body.login-v4 #loadingOverlay {
  background: rgba(15, 20, 25, 0.94) !important;
}

html[data-theme="dark"] body.login-v4 .tabs {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] body.login-v4 label,
html[data-theme="dark"] body.login-v4 .country-option span,
html[data-theme="dark"] body.login-v4 #form-title,
html[data-theme="dark"] body.login-v4 h2 {
  color: var(--text) !important;
}

html[data-theme="dark"] body.login-v4 .tab {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] body.login-v4 .tab.active {
  color: var(--accent) !important;
}

html[data-theme="dark"] body.login-v4 .requirement {
  color: var(--text-dim) !important;
}

html[data-theme="dark"] body.app-v4 .auth-success-backdrop {
  background: var(--bg-soft) !important;
}

html[data-theme="dark"] body.app-v4 .auth-success-card {
  background: var(--surface-glass) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}

html[data-theme="dark"] body.app-v4 .auth-success-card__icon {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

html[data-theme="dark"] body.app-v4 .auth-success-card__title {
  color: var(--text) !important;
}

html[data-theme="dark"] body.app-v4 .auth-success-card__subtitle {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] body.app-v4 .auth-success-card__loader {
  border-color: var(--border);
  border-top-color: var(--accent);
}
