/* Scar Alpha AI — صفحة تسجيل الدخول */
.login-page { min-height: 100vh; min-height: 100dvh; }
.login-shell {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(380px, 520px) 1fr; align-items: center;
  gap: clamp(24px, 5vw, 80px);
  padding: clamp(16px, 4vw, 56px);
  max-width: 1360px; margin: 0 auto;
}

/* ── البطاقة ── */
.auth-card {
  position: relative; min-width: 0;
  padding: 36px clamp(22px, 3.2vw, 44px) 30px;
  border-radius: var(--r-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 40%),
    rgba(12, 7, 7, .78);
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 90px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(2, 1, 1, .6);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: cardIn .9s var(--ease) both .1s;
}
/* شقّ أحمر مائل على حافة البطاقة — من زاوية اللوغو */
.auth-card::before {
  content: ''; position: absolute; top: -1px; inset-inline-start: 38px; width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-hi), transparent);
  box-shadow: 0 0 18px 2px rgba(255, 43, 28, .55);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.brand-logo .logo-tile { width: 48px; height: 48px; }

.auth-head h1 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.01em; }
.auth-head .lead { margin-top: 10px; font-family: var(--f-display); font-weight: 600; font-size: 17px; color: #ff5f50; }
.auth-head .sub { margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.8; max-width: 44ch; }

.auth-form { display: grid; gap: 18px; margin-top: 28px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; }
.link { color: #ff6b5c; font-weight: 600; font-size: 14px; transition: color .2s; }
.link:hover { color: #ff9184; text-decoration: underline; text-underline-offset: 4px; }
.btn-block { width: 100%; --h: 54px; font-size: 16px; border-radius: var(--r-md); }
.form-error { color: var(--down); font-size: 14px; display: flex; gap: 8px; align-items: center; background: var(--down-bg); border: 1px solid rgba(255, 77, 94, .25); padding: 10px 12px; border-radius: 12px; animation: shake .45s var(--ease); }
.form-ok { display: flex; gap: 10px; align-items: flex-start; color: var(--up); background: var(--up-bg); border: 1px solid rgba(43, 227, 160, .25); padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.7; }
.form-ok p { color: var(--text); }
.form-ok .ic { flex: none; margin-top: 3px; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

.auth-foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.preview-note { margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); }

.auth-views { position: relative; }
.auth-view { animation: viewIn .5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateX(-18px); } }

.btn.is-done { background: linear-gradient(180deg, #23d394, #13a874); box-shadow: 0 10px 30px -10px rgba(43, 227, 160, .7); }

/* ── المشهد ── */
.stage { display: grid; justify-items: center; gap: 22px; text-align: center; }
.emblem { position: relative; width: min(46vw, 520px); aspect-ratio: 1; animation: emblemIn 1.4s var(--ease) both .2s; }
.em-halo { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 30, 15, .55), rgba(125, 1, 1, .25) 45%, transparent 70%); animation: breathe 5s ease-in-out infinite; }
.em-ticks, .em-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.em-ticks { animation: rot 80s linear infinite; }
.em-ticks line { stroke: rgba(217, 217, 217, .22); stroke-width: 1.4; }
.em-ticks line.major { stroke: rgba(255, 60, 40, .7); stroke-width: 2; }
.em-rings circle { fill: none; }
.em-rings .r1 { stroke: rgba(217, 217, 217, .08); stroke-width: 1; }
.em-rings .r2 { stroke: rgba(221, 1, 1, .35); stroke-width: 1; stroke-dasharray: 2 7; animation: rot 50s linear infinite reverse; transform-origin: 200px 200px; }
.em-rings .r3 { stroke: var(--red-hi); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 120 822; filter: drop-shadow(0 0 6px rgba(255, 43, 28, .9)); animation: rot 7s linear infinite; transform-origin: 200px 200px; }
.em-core {
  position: absolute; inset: 31%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #2a0c0c, #0d0505 70%);
  border: 1px solid rgba(255, 60, 40, .35);
  box-shadow: 0 0 0 10px rgba(221, 1, 1, .05), 0 0 60px -6px rgba(221, 1, 1, .7), inset 0 2px 0 rgba(255, 255, 255, .06);
}
.em-core svg { width: 58%; color: #fff; filter: drop-shadow(0 0 14px rgba(255, 70, 50, .85)); animation: markPulse 5s ease-in-out infinite; }
.em-cut { position: absolute; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #ff4a32, transparent); transform: rotate(-31deg); opacity: 0; animation: cut 6s var(--ease) infinite; }
.em-cut.c1 { width: 46%; top: 30%; left: 50%; }
.em-cut.c2 { width: 64%; top: 52%; left: 4%; animation-delay: 2s; }
.em-cut.c3 { width: 38%; top: 74%; left: 40%; animation-delay: 4s; }
.stage-line { font-family: var(--f-brand); font-weight: 900; letter-spacing: .5em; font-size: 13px; color: rgba(217, 217, 217, .55); direction: ltr; margin-inline-end: -.5em; }
.stage-cap { color: var(--faint); font-size: 14px; max-width: 36ch; margin-top: -12px; }

@keyframes rot { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .75; } }
@keyframes markPulse { 50% { filter: drop-shadow(0 0 26px rgba(255, 70, 50, 1)); } }
@keyframes cut { 0% { opacity: 0; clip-path: inset(0 100% 0 0); } 12% { opacity: 1; clip-path: inset(0 0 0 0); } 30% { opacity: 0; } 100% { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes emblemIn { from { opacity: 0; transform: scale(.86) rotate(-8deg); } }

.leaving .auth-card { animation: leave .55s var(--ease-io) forwards; }
.leaving .stage { animation: leave .55s var(--ease-io) forwards .05s; }
@keyframes leave { to { opacity: 0; transform: scale(.97); filter: blur(6px); } }

/* ── الموبايل ── */
@media (max-width: 960px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); align-content: start; padding-top: max(20px, env(safe-area-inset-top)); }
  .stage { order: -1; gap: 0; }
  .emblem { width: 168px; margin-bottom: -40px; }
  .em-cut, .stage-line, .stage-cap { display: none; }
  .auth-card { width: 100%; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .login-shell { padding-inline: 16px; }
  .auth-card { padding: 28px 18px 22px; border-radius: 22px; }
  .auth-brand { margin-bottom: 22px; }
  .auth-head .sub { font-size: 14px; }
}

/* ── تحقّق Quotex البشري ── */
.quotex-hint { color: var(--ink) !important; margin-top: 8px; }
.guided { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(2, 1, 1, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: viewIn .35s var(--ease); }
.guided-panel { width: min(760px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--r-xl); background: linear-gradient(180deg, var(--s2), var(--s0)); border: 1px solid var(--red-line); box-shadow: 0 30px 80px -20px rgba(221, 1, 1, .35); }
.guided-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.guided-head h2 { margin: 0 0 4px; font-family: var(--f-display); font-size: 18px; color: var(--ink); }
.guided-head p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.guided .icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); flex: none; }
.guided .icon-btn:hover { color: var(--ink); background: rgba(217, 217, 217, .06); }
.guided-stage { position: relative; flex: 1; min-height: 240px; overflow: auto; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--s1); outline: none; }
.guided-stage:focus-visible { border-color: var(--red); }
.guided-stage img { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; }
.guided-stage.is-busy::after { content: ''; position: absolute; inset-inline-end: 12px; top: 12px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--red-hi); animation: spin .8s linear infinite; }
.guided-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.guided-loading .spin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--red-hi); animation: spin .8s linear infinite; }
.guided-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.guided-foot .is-ok { color: var(--up); }
@media (max-width: 560px) { .guided-panel { padding: 16px; } .guided-foot { flex-direction: column; align-items: stretch; } }

/* ── أداء (موبايل وأجهزة لمسية): نفس الشكل بدون البلور والحركات اللي بتعيد رسم الشاشة كل فريم ── */
@media (max-width: 1024px), (pointer: coarse) {
  .auth-card, .guided { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .auth-card { background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 40%), rgba(12, 7, 7, .96); }
  .backdrop .glow, .backdrop .scar::after { animation: none !important; will-change: auto; }
  .em-rings .r2, .em-rings .r3, .em-cut { animation: none !important; }
  .em-core svg { animation: none !important; }
}
