/* iTraxX Login — Zoooms layout + light / dark / premium themes */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body.login-page {
  height: 100%;
}

/* ── Light theme (Zoooms default) ───────────────────────────────────────── */
body.login-page {
  --bg: #fcf5fc;
  --card: #fefff4;
  --border: #cbcacc;
  --text: #18181b;
  --muted: #71717a;
  --subtle: #a1a1aa;
  --input-bdr: rgba(0, 0, 0, 0.12);
  --table-hov: #f0f0f2;
  --accent: #2563eb;
  --accent-dk: #1d4ed8;
  --green: #16a34a;
  --green-lt: #dcfce7;
  --red: #dc2626;
  --red-lt: #fee2e2;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

  min-height: 100vh;
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: stretch;
  position: relative;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.login-page input,
body.login-page textarea,
body.login-page select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

body.login-page button,
body.login-page .login-submit,
body.login-page .login-theme-toggle,
body.login-page .login-eye {
  -webkit-user-select: none;
  user-select: none;
}

/* ── Dark theme (Zoooms dark) ───────────────────────────────────────────── */
body.login-page.theme-dark {
  --bg: #09090b;
  --card: #18181b;
  --border: rgba(255, 255, 255, 0.07);
  --text: #fafafa;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --input-bdr: rgba(255, 255, 255, 0.1);
  --table-hov: #222225;
  --accent: #3b82f6;
  --accent-dk: #60a5fa;
  --green: #22c55e;
  --green-lt: #14532d;
  --red: #ef4444;
  --red-lt: #450a0a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ── Premium theme (iTraxX glassmorphism) ───────────────────────────────── */
body.login-page.theme-premium {
  --bg: #0f172a;
  --card: rgba(15, 23, 42, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --subtle: #64748b;
  --input-bdr: rgba(255, 255, 255, 0.12);
  --table-hov: rgba(255, 255, 255, 0.06);
  --accent: #6366f1;
  --accent-dk: #8b5cf6;
  --green: #22c55e;
  --green-lt: rgba(34, 197, 94, 0.12);
  --red: #f87171;
  --red-lt: rgba(239, 68, 68, 0.12);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

body.login-page.theme-premium::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(15, 23, 42, 1) 100%);
  animation: rotateBg 30s linear infinite;
  z-index: 0;
  pointer-events: none;
}

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

.glow-orb-1,
.glow-orb-2 {
  display: none;
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 1;
  opacity: 0.5;
  pointer-events: none;
}

body.login-page.theme-premium .glow-orb-1,
body.login-page.theme-premium .glow-orb-2 {
  display: block;
}

.glow-orb-1 {
  background: #6366f1;
  top: 10%;
  left: 20%;
  animation: floatOrb1 15s ease-in-out infinite alternate;
}

.glow-orb-2 {
  background: #ec4899;
  bottom: 15%;
  right: 20%;
  animation: floatOrb2 18s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.2); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-40px, -50px) scale(0.9); }
}

body.login-page.theme-premium .login-left {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.login-page.theme-premium .login-right {
  background: transparent;
}

body.login-page.theme-premium .login-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

body.login-page.theme-premium .login-submit {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

body.login-page.theme-premium .login-submit:hover:not([disabled]) {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45);
}

body.login-page-super.theme-premium .login-submit {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

/* ── Theme toggle (3-way cycle) ─────────────────────────────────────────── */
.login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 20;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.12s;
}

.login-theme-toggle:hover {
  background: var(--table-hov);
  transform: scale(1.08);
}

/* ── Two-column layout ──────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

.login-left {
  flex: 1;
  background: #18181b;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-left::before,
.login-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-left::before {
  width: 520px;
  height: 520px;
  top: -180px;
  right: -160px;
  background: rgba(37, 99, 235, 0.14);
}

.login-left::after {
  width: 340px;
  height: 340px;
  bottom: -120px;
  left: -80px;
  background: rgba(99, 102, 241, 0.1);
}

.login-left-inner {
  position: relative;
  z-index: 1;
  padding: 56px 52px;
  max-width: 480px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 52px;
}

.login-brand-icon,
.login-card-icon {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.login-card-icon {
  width: 80px;
  height: 80px;
  border-radius: 10px;
}

.login-brand-name {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.login-headline {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
}

.login-tagline {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.5);
  max-width: 380px;
  margin-bottom: 44px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

.login-feature-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ── Right panel ────────────────────────────────────────────────────────── */
.login-right {
  width: 50%;
  min-width: min(500px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.login-card-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.login-card-sub {
  font-size: 11px;
  color: var(--muted);
}

.login-card-title {
  font-size: 27px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.login-error,
.login-success {
  display: none;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.login-error.is-visible,
.login-success.is-visible {
  display: flex;
}

.login-error {
  background: var(--red-lt);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.login-success {
  background: var(--green-lt);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, 0.18);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Fields ─────────────────────────────────────────────────────────────── */
.login-field {
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 12px;
  font-size: 15px;
  color: var(--muted);
  pointer-events: none;
  line-height: 1;
}

.login-input-wrap input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--input-bdr);
  border-radius: 10px;
  padding: 12px 44px 12px 40px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.login-page.theme-premium .login-input-wrap input:focus {
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.login-input-wrap input.login-input-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.login-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  padding: 4px;
  transition: color 0.12s;
}

.login-eye:hover {
  color: var(--text);
}

.login-field-err {
  display: none;
  font-size: 11.5px;
  color: var(--red);
  font-weight: 600;
  margin-top: 5px;
}

.login-field-err.is-visible {
  display: block;
}

/* ── Submit ─────────────────────────────────────────────────────────────── */
.login-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}

.login-submit:hover:not([disabled]) {
  background: var(--accent-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.login-submit:active:not([disabled]) {
  transform: translateY(0);
}

.login-submit[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-spinner::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

.login-footer {
  margin-top: 22px;
  text-align: center;
}

.login-footer a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease;
  color: #fff;
}

.toast--success { background: var(--green); }
.toast--error { background: var(--red); }
.toast--info { background: var(--accent); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  html,
  body.login-page {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  body.login-page {
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .login-wrap {
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .login-left {
    display: none;
  }

  .login-right {
    width: 100%;
    min-width: 0 !important;
    height: 100%;
    max-height: 100dvh;
    padding: 56px 18px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
  }

  .login-card {
    max-width: 400px;
    margin: 0 auto;
  }

  .login-brand-icon,
  .login-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .login-card-logo {
    margin-bottom: 16px;
    gap: 10px;
  }

  .login-card-brand {
    font-size: 14px;
  }

  .login-card-title {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .login-card-desc {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .login-field {
    margin-bottom: 12px;
  }

  .login-input-wrap input {
    padding: 11px 44px 11px 40px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .login-submit {
    padding: 12px;
    margin-top: 4px;
  }

  .login-error,
  .login-success {
    margin-bottom: 12px;
    padding: 9px 12px;
  }

  .login-theme-toggle {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  body.login-page.theme-premium .login-card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  body.login-page.theme-premium::before,
  body.login-page.theme-premium .glow-orb-1,
  body.login-page.theme-premium .glow-orb-2 {
    display: none;
  }

  .toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
}

/* Short phones / landscape — tighter card */
@media (max-width: 860px) and (max-height: 700px) {
  .login-right {
    padding: 48px 16px 12px;
    align-items: flex-start;
  }

  .login-card-logo {
    margin-bottom: 10px;
  }

  .login-brand-icon,
  .login-card-icon {
    width: 40px;
    height: 40px;
  }

  .login-card-title {
    font-size: 20px;
  }

  .login-card-desc {
    margin-bottom: 12px;
  }

  .login-field {
    margin-bottom: 10px;
  }

  body.login-page.theme-premium .login-card {
    padding: 14px 14px;
  }
}

@media (max-width: 860px) and (max-height: 520px) {
  .login-card-logo {
    display: none;
  }

  .login-card-desc {
    display: none;
  }

  .login-right {
    padding-top: 44px;
  }
}

