/* ================================================================
   LOGIN PAGE — Modern, Fresh, Eye-Friendly
   ================================================================ */

/* ── Page scaffold ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

/* ── Ambient background orbs ── */
.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.38;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255,107,0,0.55), transparent 70%);
  top: -160px;
  right: -120px;
  animation-duration: 14s;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255,160,60,0.3), transparent 70%);
  bottom: -140px;
  left: -100px;
  animation-duration: 18s;
  animation-delay: -6s;
}

.light-theme .orb { opacity: 0.18; }

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, 30px) scale(1.06); }
}

/* ── Theme toggle placement ── */
.login-theme-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
}

/* ── Outer wrap — full height so footer stays at bottom ── */
.login-page {
  flex-direction: column;
}

.login-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}

/* ── Legal footer pinned at the bottom ── */
.login-legal {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  z-index: 5;
  pointer-events: none;
}

/* ── Card ── */
.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.04),
    0 20px 60px rgba(0,0,0,0.14),
    inset 0 1px 0 rgba(255,255,255,0.04);
  animation: cardIn 0.45s cubic-bezier(.16,1,.3,1) both;
}

.light-theme .login-card {
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 12px 40px rgba(0,0,0,0.08);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Brand ── */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.login-logo-ring {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.12), 0 8px 24px rgba(0,0,0,0.18);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.light-theme .login-logo-ring {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.1), 0 8px 20px rgba(0,0,0,0.06);
}

.login-logo-ring img {
  width: 100%;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  display: block;
}

.login-brand-text {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.login-brand-text .brand-g  { color: #f8fafc; }
.login-brand-text .brand-dash { color: #cbd5e1; }
.login-brand-text .brand-x { color: #f97316; }

.light-theme .login-brand-text .brand-g  { color: #1f2937; }
.light-theme .login-brand-text .brand-dash { color: #475569; }
.light-theme .login-brand-text .brand-x { color: #f97316; }

.login-brand-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ea580c;
  opacity: 1;
}

/* ── Heading ── */
.login-heading {
  text-align: center;
  margin-bottom: 24px;
}

.login-heading h1 {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.login-heading p {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0;
}

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

/* ── Field group ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-group input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}

.field-group input::placeholder {
  color: var(--text-faint);
}

.field-group input:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.15);
}

/* ── Label row with link ── */
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-label-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-link {
  font-size: 12px;
  font-weight: 600;
  color: #FF6B00;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.field-link:hover { opacity: 1; text-decoration: underline; }

/* ── Password field wrapper ── */
.field-relative {
  position: relative;
}

.field-relative input {
  padding-right: 44px;
}

.eye-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  transition: color 0.15s;
}

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

.eye-btn svg { width: 18px; height: 18px; }

.eye-btn:focus-visible,
.field-link:focus-visible,
.footer-link:focus-visible {
  outline: 2px solid #FF6B00;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Primary CTA button ── */
.btn-primary-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: #FF6B00;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 20px rgba(255,107,0,0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  margin-top: 4px;
}

.btn-primary-full:hover {
  background: #e85f00;
  box-shadow: 0 6px 28px rgba(255,107,0,0.45);
  transform: translateY(-1px);
}

.btn-primary-full:active {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 2px 12px rgba(255,107,0,0.3);
}

.btn-primary-full svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ── Footer links ── */
.login-footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.login-footer-links p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.footer-link {
  font-size: 13px;
  font-weight: 600;
  color: #FF6B00;
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer-link:hover { opacity: 0.8; text-decoration: underline; }


/* ── Responsive small screens ── */
@media (max-width: 440px) {
  .login-card {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }

  .login-logo-ring {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .login-brand-text { font-size: 19px; }
  .login-heading h1 { font-size: 21px; }
}

/* ── Light-theme form input overrides ── */
.light-theme .field-group input {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.light-theme .field-group input::placeholder {
  color: var(--text-faint);
}

.light-theme .field-group input:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.12);
}

/* ── SweetAlert2 GXpress Theme ── */
.swal2-container {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background: rgba(10, 10, 11, 0.75) !important;
  z-index: 10000 !important;
}

.swal2-popup.gx-swal-popup,
.swal2-popup {
  background: var(--surface, #17171A) !important;
  border: 1px solid var(--border, #26262A) !important;
  border-radius: 20px !important;
  padding: 28px 24px 24px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  color: var(--text, #FFFFFF) !important;
  font-family: 'Inter', sans-serif !important;
  max-width: 390px !important;
  width: 90% !important;
}

.light-theme .swal2-popup.gx-swal-popup,
.light-theme .swal2-popup {
  background: #FFFFFF !important;
  border-color: #E0E0E5 !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12) !important;
  color: #141416 !important;
}

.swal2-title {
  font-family: 'Sora', sans-serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--text, #FFFFFF) !important;
  letter-spacing: -0.02em !important;
  padding: 0 0 6px !important;
  margin: 0 !important;
}

.light-theme .swal2-title {
  color: #141416 !important;
}

.swal2-html-container {
  font-family: 'Inter', sans-serif !important;
  font-size: 13.5px !important;
  color: var(--text-dim, #8A8A93) !important;
  line-height: 1.55 !important;
  margin: 8px 0 20px !important;
}

.light-theme .swal2-html-container {
  color: #616168 !important;
}

.swal2-actions {
  margin-top: 8px !important;
  gap: 10px !important;
  width: 100% !important;
}

.swal2-confirm.gx-swal-confirm,
.swal2-confirm {
  background: #FF6B00 !important;
  color: #FFFFFF !important;
  font-family: 'Sora', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 12px 24px !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(255,107,0,0.35) !important;
  transition: all 0.18s ease !important;
  flex: 1 !important;
  outline: none !important;
  cursor: pointer !important;
}

.swal2-confirm:hover {
  background: #e85f00 !important;
  box-shadow: 0 6px 22px rgba(255,107,0,0.45) !important;
  transform: translateY(-1px) !important;
}

.swal2-confirm:active {
  transform: scale(0.98) translateY(0) !important;
}

.swal2-cancel {
  background: var(--surface-2, #202023) !important;
  color: var(--text-dim, #8A8A93) !important;
  border: 1px solid var(--border, #26262A) !important;
  border-radius: 12px !important;
  padding: 12px 20px !important;
  font-family: 'Sora', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  flex: 1 !important;
}

.swal2-icon {
  margin: 8px auto 16px !important;
  transform: scale(0.85) !important;
}

.swal2-icon.swal2-error {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
  background-color: #ef4444 !important;
}

.swal2-icon.swal2-warning {
  border-color: #f59e0b !important;
  color: #f59e0b !important;
}

.swal2-icon.swal2-success {
  border-color: #10b981 !important;
  color: #10b981 !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
  background-color: #10b981 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.swal2-icon.swal2-info {
  border-color: #FF6B00 !important;
  color: #FF6B00 !important;
}

@media (display-mode: standalone) {
  body.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(20px + max(env(safe-area-inset-top, 0px), 60px));
    padding-bottom: calc(28px + max(env(safe-area-inset-bottom, 0px), 20px));
  }

  .login-theme-btn {
    top: max(env(safe-area-inset-top, 0px), 60px);
    right: max(env(safe-area-inset-right, 0px), 18px);
  }

  .login-legal {
    bottom: max(env(safe-area-inset-bottom, 0px), 16px);
  }
}
