:root {
  --im-bg-0: #050509;
  --im-bg-1: #0b1324;
  --im-bg-2: #101a2f;
  --im-card: rgba(255, 255, 255, 0.96);
  --im-card-2: rgba(255, 255, 255, 0.82);
  --im-text: #0f172a;
  --im-muted: rgba(15, 23, 42, 0.65);
  --im-border: rgba(15, 23, 42, 0.10);
  --im-border-2: rgba(15, 23, 42, 0.18);
  --im-focus: rgba(14, 165, 233, 0.30);
  --im-ice: #0ea5e9;
  --im-ice-2: #38bdf8;
  --im-fire: #f97316;
  --im-fire-2: #ea580c;
  --im-ok: #16a34a;
  --im-warn: #f59e0b;
  --im-bad: #ef4444;
  --im-shadow: 0 25px 60px rgba(2, 6, 23, 0.35);
  --im-shadow-soft: 0 12px 30px rgba(2, 6, 23, 0.18);
  --im-radius: 24px;
  --im-radius-sm: 14px;
  --im-speed: 300ms;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--im-text);
  font-family: "Tajawal", "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

/* ── Animated Mesh Background ── */
.im-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 450px at 18% 12%, rgba(56, 189, 248, 0.30), transparent 58%),
    radial-gradient(900px 500px at 86% 18%, rgba(249, 115, 22, 0.26), transparent 62%),
    radial-gradient(900px 600px at 50% 92%, rgba(239, 68, 68, 0.20), transparent 64%),
    linear-gradient(180deg, var(--im-bg-0) 0%, var(--im-bg-1) 55%, #111827 100%);
}

.im-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 350px at 30% 40%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(700px 350px at 70% 60%, rgba(249, 115, 22, 0.10), transparent 60%);
  animation: im-bg-breath 8s ease-in-out infinite alternate;
}

@keyframes im-bg-breath {
  0% { transform: scale(1) translate(0, 0); opacity: 0.7; }
  50% { transform: scale(1.02) translate(1%, -1%); opacity: 0.9; }
  100% { transform: scale(1) translate(0, 0); opacity: 0.7; }
}

/* floating orbs */
.im-bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  animation: im-orb-float 12s ease-in-out infinite alternate;
}

.im-bg-orb--1 {
  width: 400px; height: 400px;
  background: rgba(14, 165, 233, 0.12);
  top: -100px; inset-inline-start: -100px;
  animation-delay: 0s;
}

.im-bg-orb--2 {
  width: 350px; height: 350px;
  background: rgba(249, 115, 22, 0.10);
  bottom: -80px; inset-inline-end: -80px;
  animation-delay: -4s;
}

.im-bg-orb--3 {
  width: 250px; height: 250px;
  background: rgba(239, 68, 68, 0.08);
  top: 50%; left: 50%;
  animation-delay: -8s;
}

@keyframes im-orb-float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, 2%) scale(1.05); }
  66% { transform: translate(-2%, -1%) scale(0.97); }
  100% { transform: translate(0, 0) scale(1); }
}

/* subtle grid overlay */
.im-bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── Layout ── */
.im-auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: clamp(16px, 3vw, 36px);
  animation: im-fade-in 0.6s ease-out;
}

@keyframes im-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.im-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 980px) {
  .im-shell {
    grid-template-columns: 1.06fr 0.94fr;
    align-items: stretch;
    gap: 28px;
  }
}

/* ── Brand Section ── */
.im-brand {
  position: relative;
  border-radius: var(--im-radius);
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(900px 480px at 20% 10%, rgba(14, 165, 233, 0.28), transparent 60%),
    radial-gradient(800px 420px at 80% 30%, rgba(249, 115, 22, 0.20), transparent 62%),
    linear-gradient(135deg, #0b1324 0%, #131e36 50%, #1f2937 100%);
  box-shadow: var(--im-shadow-soft);
  display: none;
  animation: im-slide-in 0.7s ease-out;
}

@media (min-width: 980px) {
  .im-brand { display: grid; }
}

@keyframes im-slide-in {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.im-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(14, 165, 233, 0.18), transparent 55%),
    linear-gradient(300deg, rgba(249, 115, 22, 0.14), transparent 55%);
  pointer-events: none;
}

/* decorative rings */
.im-brand-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.im-brand-ring--1 {
  width: 480px; height: 480px;
  top: -120px; inset-inline-end: -120px;
  animation: im-ring-spin 30s linear infinite;
}

.im-brand-ring--2 {
  width: 360px; height: 360px;
  bottom: -80px; inset-inline-start: -80px;
  animation: im-ring-spin 40s linear infinite reverse;
}

.im-brand-ring--3 {
  width: 200px; height: 200px;
  top: 40%; inset-inline-end: 10%;
  animation: im-ring-spin 25s linear infinite;
  border-color: rgba(255, 255, 255, 0.04);
}

@keyframes im-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.im-brand-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
  align-content: center;
}

.im-brand-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.im-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.25);
}

.im-brand-title {
  font-weight: 900;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  margin: 0;
  background: linear-gradient(90deg, var(--im-ice-2) 0%, #ffffff 40%, var(--im-fire) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.im-brand-subtitle {
  margin: 0;
  max-width: 48ch;
  color: rgba(226, 232, 240, 0.86);
  font-size: 1.05rem;
  line-height: 1.85;
}

/* Feature list in brand panel */
.im-brand-features {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.im-brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--im-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.im-brand-feature-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.15);
  color: var(--im-ice-2);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.im-brand-feature-text {
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.80);
  line-height: 1.5;
}

.im-brand-feature-text strong {
  color: #ffffff;
}

/* ── Panel Section ── */
.im-panel {
  position: relative;
  border-radius: var(--im-radius);
  overflow: hidden;
  box-shadow: var(--im-shadow);
  background:
    radial-gradient(900px 480px at 10% 0%, rgba(14, 165, 233, 0.06), transparent 60%),
    radial-gradient(900px 520px at 92% 18%, rgba(249, 115, 22, 0.06), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.60);
  animation: im-panel-in 0.7s ease-out 0.1s both;
}

@keyframes im-panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* subtle inner glow */
.im-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.04), transparent 50%),
    linear-gradient(225deg, rgba(249, 115, 22, 0.03), transparent 50%);
  pointer-events: none;
}

.im-panel::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--im-ice), var(--im-ice-2) 40%, var(--im-fire) 100%);
  pointer-events: none;
}

.im-panel-inner {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 3.6vw, 44px);
  display: grid;
  gap: 20px;
}

/* ── Topbar ── */
.im-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.im-company {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.im-company-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(249, 115, 22, 0.08));
  border: 1px solid var(--im-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

@media (min-width: 980px) {
  .im-company-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
}

.im-company-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.im-company-logo svg {
  width: 28px;
  height: 28px;
}

.im-company-name {
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(90deg, var(--im-ice) 0%, var(--im-fire) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.im-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--im-border);
  background: rgba(255, 255, 255, 0.60);
  color: rgba(15, 23, 42, 0.75);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform var(--im-speed) ease, border-color var(--im-speed) ease, background-color var(--im-speed) ease, box-shadow var(--im-speed) ease;
}

.im-lang:hover {
  transform: translateY(-1px);
  border-color: var(--im-border-2);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.08);
}

.im-lang:focus-visible {
  outline: 3px solid var(--im-focus);
  outline-offset: 2px;
}

/* ── Header ── */
.im-head {
  display: grid;
  gap: 6px;
  padding-block: 4px;
}

.im-head h1 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--im-text);
}

.im-head p {
  margin: 0;
  color: var(--im-muted);
  font-weight: 600;
  line-height: 1.7;
}

/* ── Form ── */
.im-form { display: grid; gap: 16px; }

.im-field {
  position: relative;
  display: grid;
  gap: 6px;
}

/* input wrapper for icon + input combo */
.im-input-wrap {
  position: relative;
  display: grid;
}

.im-input-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 14px;
  transform: translateY(-50%);
  width: 20px;
  color: rgba(15, 23, 42, 0.35);
  pointer-events: none;
  transition: color var(--im-speed) ease;
  z-index: 2;
  display: grid;
  place-items: center;
}

.im-input-icon svg {
  width: 18px;
  height: 18px;
}

.im-input:focus ~ .im-input-icon {
  color: rgba(14, 165, 233, 0.65);
}

.im-input {
  width: 100%;
  padding: 18px 14px;
  padding-inline-start: 44px;
  padding-inline-end: 50px;
  border-radius: var(--im-radius-sm);
  border: 1.5px solid var(--im-border);
  background: rgba(255, 255, 255, 0.70);
  color: var(--im-text);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  transition: border-color var(--im-speed) ease, box-shadow var(--im-speed) ease, background-color var(--im-speed) ease, transform var(--im-speed) ease;
}

.im-input::placeholder { color: transparent; }

.im-input:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--im-border-2);
}

.im-input:focus {
  outline: none;
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 5px var(--im-focus);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.im-input.is-error {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.10);
}

.im-input.is-error:focus {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.15);
}

.im-input:focus ~ .im-pass-toggle {
  opacity: 1;
}

.im-label {
  position: absolute;
  inset-inline-start: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(15, 23, 42, 0.55);
  font-weight: 800;
  font-size: 0.9rem;
  pointer-events: none;
  transition: transform var(--im-speed) ease, color var(--im-speed) ease, opacity var(--im-speed) ease, font-size var(--im-speed) ease;
  background: transparent;
  padding-inline: 4px;
  border-radius: 4px;
  transform-origin: center right;
  z-index: 1;
}

.im-input:focus + .im-input-icon + .im-label,
.im-input:not(:placeholder-shown) + .im-input-icon + .im-label {
  top: 0;
  transform: translateY(-50%) scale(0.88);
  color: rgba(14, 165, 233, 0.90);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 40%, transparent 100%);
  padding-inline: 8px;
  padding-block: 0 4px;
}

.im-label.has-value {
  top: 0;
  transform: translateY(-50%) scale(0.88);
  color: rgba(14, 165, 233, 0.90);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 40%, transparent 100%);
  padding-inline: 8px;
  padding-block: 0 4px;
}

.im-pass-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  transition: transform var(--im-speed) ease, background-color var(--im-speed) ease, color var(--im-speed) ease, opacity var(--im-speed) ease;
  opacity: 0.7;
  z-index: 2;
}

.im-pass-toggle:hover {
  transform: translateY(calc(-50% - 1px));
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.70);
  opacity: 1;
}

.im-pass-toggle:focus-visible {
  outline: 3px solid var(--im-focus);
  outline-offset: 2px;
  opacity: 1;
}

.im-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.im-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  cursor: pointer;
}

.im-check input {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--im-border-2);
  background: rgba(255, 255, 255, 0.80);
  display: grid;
  place-items: center;
  margin: 0;
  cursor: pointer;
  transition: border-color var(--im-speed) ease, background-color var(--im-speed) ease, box-shadow var(--im-speed) ease;
}

.im-check input:hover {
  border-color: rgba(14, 165, 233, 0.40);
  background: rgba(255, 255, 255, 0.95);
}

.im-check input::before {
  content: "\2713";
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  transform: scale(0);
  transition: transform var(--im-speed) ease;
  line-height: 1;
}

.im-check input:checked {
  background: linear-gradient(135deg, var(--im-ice), var(--im-fire));
  border-color: transparent;
}

.im-check input:checked::before { transform: scale(1); }

.im-check input:focus-visible {
  outline: 3px solid var(--im-focus);
  outline-offset: 3px;
}

.im-check span {
  font-weight: 800;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.78);
}

.im-link {
  font-weight: 900;
  text-decoration: none;
  color: rgba(2, 132, 199, 0.92);
  transition: color var(--im-speed) ease, transform var(--im-speed) ease;
  font-size: 0.9rem;
}

.im-link:hover {
  color: rgba(234, 88, 12, 0.95);
  text-decoration: underline;
}

.im-link:focus-visible {
  outline: 3px solid var(--im-focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Button ── */
.im-btn {
  width: 100%;
  border: 0;
  border-radius: calc(var(--im-radius-sm) + 4px);
  padding: 16px 20px;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.3px;
  color: #ffffff;
  background:
    linear-gradient(90deg, var(--im-ice) 0%, rgba(56, 189, 248, 0.95) 40%, var(--im-fire) 100%);
  background-size: 120% 100%;
  background-position: 0% 50%;
  box-shadow:
    0 16px 40px rgba(14, 165, 233, 0.22),
    0 14px 34px rgba(249, 115, 22, 0.16);
  cursor: pointer;
  transition:
    transform var(--im-speed) ease,
    filter var(--im-speed) ease,
    box-shadow var(--im-speed) ease,
    background-position var(--im-speed) ease;
  position: relative;
  overflow: hidden;
}

.im-btn::after {
  content: "";
  position: absolute;
  inset: -80px;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.20), transparent 55%);
  transform: translateX(-30%);
  opacity: 0;
  transition: opacity var(--im-speed) ease, transform var(--im-speed) ease;
  pointer-events: none;
}

.im-btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow:
    0 20px 50px rgba(14, 165, 233, 0.28),
    0 18px 44px rgba(249, 115, 22, 0.18);
  background-position: 50% 50%;
}

.im-btn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.im-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow:
    0 8px 20px rgba(14, 165, 233, 0.18),
    0 6px 16px rgba(249, 115, 22, 0.12);
  filter: saturate(1);
}

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

.im-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}

/* loading state */
.im-btn.is-loading {
  color: transparent;
  pointer-events: none;
}

.im-btn.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
}

.im-btn.is-loading .im-btn-spinner {
  display: block;
}

.im-btn-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.30);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: im-spin 0.7s linear infinite;
}

@keyframes im-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.im-btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: im-ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes im-ripple {
  to { transform: scale(4); opacity: 0; }
}

.im-hint {
  color: rgba(15, 23, 42, 0.55);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: center;
}

.im-error {
  margin: 0;
  font-weight: 800;
  color: rgba(220, 38, 38, 0.92);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Alerts ── */
.im-alerts { display: grid; gap: 10px; }

.im-alert {
  border-radius: var(--im-radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.10);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.10);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--im-speed) ease, transform var(--im-speed) ease, box-shadow var(--im-speed) ease;
}

.im-alert.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.im-alert:hover {
  box-shadow: 0 16px 32px rgba(2, 6, 23, 0.14);
}

.im-alert strong {
  display: block;
  font-weight: 900;
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.im-alert p {
  margin: 0;
  color: rgba(15, 23, 42, 0.78);
  font-weight: 700;
  line-height: 1.6;
}

.im-alert.im-success { border-color: rgba(22, 163, 74, 0.35); background: rgba(240, 253, 244, 0.90); }
.im-alert.im-danger { border-color: rgba(239, 68, 68, 0.35); background: rgba(254, 242, 242, 0.90); }
.im-alert.im-info { border-color: rgba(14, 165, 233, 0.35); background: rgba(240, 249, 255, 0.90); }
.im-alert.im-warning { border-color: rgba(245, 158, 11, 0.35); background: rgba(255, 251, 235, 0.90); }

.im-alert-close {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  cursor: pointer;
  color: rgba(15, 23, 42, 0.60);
  display: grid;
  place-items: center;
  transition: background-color var(--im-speed) ease, transform var(--im-speed) ease, color var(--im-speed) ease;
  flex-shrink: 0;
}

.im-alert-close:hover {
  background: rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
  color: rgba(15, 23, 42, 0.80);
}

.im-alert-close:focus-visible {
  outline: 3px solid var(--im-focus);
  outline-offset: 2px;
}

/* ── Footer ── */
.im-foot {
  padding-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: rgba(15, 23, 42, 0.45);
  font-weight: 800;
  font-size: 0.85rem;
}

.im-foot-heart {
  color: var(--im-bad);
  display: inline-block;
  animation: im-heartbeat 1.5s ease-in-out infinite;
}

@keyframes im-heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
  .im-bg::before { animation: none; }
  .im-bg-orb { animation: none; }
  .im-brand-ring { animation: none; }
}

/* ── Dark mode detection ── */
@media (prefers-color-scheme: dark) {
  .im-panel {
    background:
      radial-gradient(900px 480px at 10% 0%, rgba(14, 165, 233, 0.10), transparent 60%),
      radial-gradient(900px 520px at 92% 18%, rgba(249, 115, 22, 0.10), transparent 62%),
      linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.92) 100%);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .im-panel .im-head h1 { color: #f1f5f9; }
  .im-panel .im-head p { color: rgba(226, 232, 240, 0.70); }

  .im-input {
    background: rgba(30, 41, 59, 0.60);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.10);
  }

  .im-input:hover {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(255, 255, 255, 0.16);
  }

  .im-input:focus {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(56, 189, 248, 0.45);
  }

  .im-label { color: rgba(226, 232, 240, 0.55); }
  .im-input:focus + .im-input-icon + .im-label,
  .im-input:not(:placeholder-shown) + .im-input-icon + .im-label { color: rgba(56, 189, 248, 0.85); background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 40%, transparent 100%); }
  .im-label.has-value { color: rgba(56, 189, 248, 0.85); background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 40%, transparent 100%); }

  .im-input-icon { color: rgba(226, 232, 240, 0.30); }
  .im-input:focus ~ .im-input-icon { color: rgba(56, 189, 248, 0.55); }

  .im-pass-toggle { color: rgba(226, 232, 240, 0.45); }
  .im-pass-toggle:hover { background: rgba(255, 255, 255, 0.08); color: rgba(226, 232, 240, 0.70); }

  .im-lang { background: rgba(255, 255, 255, 0.08); color: rgba(226, 232, 240, 0.75); border-color: rgba(255, 255, 255, 0.10); }
  .im-lang:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }

  .im-check input { background: rgba(30, 41, 59, 0.60); border-color: rgba(255, 255, 255, 0.16); }
  .im-check input:hover { background: rgba(30, 41, 59, 0.80); border-color: rgba(56, 189, 248, 0.35); }
  .im-check span { color: rgba(226, 232, 240, 0.75); }

  .im-company-logo { border-color: rgba(255, 255, 255, 0.10); }

  .im-alert { background: rgba(30, 41, 59, 0.70); border-color: rgba(255, 255, 255, 0.08); }
  .im-alert strong { color: #f1f5f9; }
  .im-alert p { color: rgba(226, 232, 240, 0.70); }
  .im-alert-close { background: rgba(255, 255, 255, 0.06); color: rgba(226, 232, 240, 0.60); }
  .im-alert-close:hover { background: rgba(255, 255, 255, 0.10); color: rgba(226, 232, 240, 0.80); }
  .im-alert.im-success { background: rgba(22, 163, 74, 0.15); }
  .im-alert.im-danger { background: rgba(239, 68, 68, 0.15); }
  .im-alert.im-info { background: rgba(14, 165, 233, 0.15); }
  .im-alert.im-warning { background: rgba(245, 158, 11, 0.15); }

  .im-hint { color: rgba(226, 232, 240, 0.50); }
  .im-foot { color: rgba(226, 232, 240, 0.40); }
  .im-link { color: rgba(56, 189, 248, 0.85); }
}
