/* Login — a brand panel (ink, slow gold light, the orbiting mark) beside the form. */

.login-body { min-height: 100vh; background: var(--surface-page); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }

/* ---------- brand panel ---------- */
.login-brand-panel {
  position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px;
  background: radial-gradient(120% 90% at 85% 0%, #2a2620 0%, #161618 55%, #0f0f10 100%); color: #eeeef1;
}
.login-brand-panel::before { /* faint ruled-paper texture, like the site's library */
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: repeating-linear-gradient(0deg, rgb(255 255 255 / .025) 0 1px, transparent 1px 34px);
}
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: orb-drift 14s ease-in-out infinite alternate; }
.orb.o1 { width: 420px; height: 420px; background: #b8732e; top: -120px; right: -100px; }
.orb.o2 { width: 320px; height: 320px; background: #e19947; bottom: -110px; left: -60px; animation-duration: 18s; opacity: .35; }
.orb.o3 { width: 200px; height: 200px; background: #fdd399; top: 45%; left: 30%; animation-duration: 11s; opacity: .18; }
@keyframes orb-drift { to { transform: translate(-40px, 30px) scale(1.12); } }

.brand-inner { position: relative; z-index: 1; max-width: 460px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.brand-mark { position: relative; width: 300px; height: 300px; display: grid; place-items: center; margin-bottom: 10px; }
.brand-mark img { position: relative; width: 220px; height: 220px; border-radius: 50%; box-shadow: 0 24px 60px rgb(0 0 0 / .45); animation: mark-in .9s var(--ease-spring) both, mark-float 5s ease-in-out .9s infinite; }
.brand-mark .halo { position: absolute; width: 250px; height: 250px; border-radius: 50%; background: radial-gradient(circle, rgb(253 211 153 / .45), transparent 65%); animation: halo 4s ease-in-out infinite; }
.brand-mark .orbit { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1px solid rgb(253 211 153 / .22); animation: turn 16s linear infinite; }
.brand-mark .orbit.or1 { width: 262px; height: 262px; }
.brand-mark .orbit.or2 { width: 300px; height: 300px; animation-duration: 24s; animation-direction: reverse; border-style: dashed; border-color: rgb(253 211 153 / .14); }
.brand-mark .orbit i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fdd399; box-shadow: 0 0 14px 3px rgb(253 211 153 / .7); }
@keyframes mark-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes mark-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes halo { 0%, 100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes turn { to { transform: rotate(360deg); } }

.brand-inner h2 { font-size: 34px; font-weight: 900; line-height: 1.35; color: #ffffff; animation: fadeInUp .7s var(--ease) .25s both; }
.brand-inner h2 span {
  background: linear-gradient(90deg, #fdd399, #e19947, #fdd399); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 4s linear infinite;
}
.brand-inner p { margin: 0; font-size: 17px; color: #c9c5bd; line-height: 1.8; animation: fadeInUp .7s var(--ease) .35s both; }
.brand-chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.brand-chips li {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px; font-size: 14.5px; font-weight: 700;
  background: rgb(255 255 255 / .06); border: 1px solid rgb(253 211 153 / .18); color: #f3e7d4;
  animation: popIn .5s var(--ease-spring) both;
}
.brand-chips li .icon { color: #fdd399; }
.brand-chips li:nth-child(1) { animation-delay: .5s; } .brand-chips li:nth-child(2) { animation-delay: .6s; }
.brand-chips li:nth-child(3) { animation-delay: .7s; } .brand-chips li:nth-child(4) { animation-delay: .8s; }

/* ---------- form side ---------- */
.login-main {
  display: grid; place-items: center; align-content: center; gap: 18px;
  padding-block: 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  background:
    radial-gradient(60% 50% at 10% 100%, color-mix(in srgb, var(--gold-300) 22%, transparent), transparent 70%),
    var(--surface-page);
}
.login-card {
  width: min(440px, 100%); padding: 36px 34px 26px; border-radius: 26px;
  background: var(--surface-raised); border: 1px solid var(--surface-line); box-shadow: var(--shadow-lg);
  position: relative; animation: popIn .6s var(--ease-spring) .1s both;
}
.login-card::before { content: ''; position: absolute; inset-inline: 34px; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--gold-300), var(--gold-600)); }
.login-card.has-errors { animation: popIn .6s var(--ease-spring) .1s both, shake .45s var(--ease) .7s both; }
.login-head { display: flex; align-items: center; gap: 14px; }
.mini-logo { width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 4px var(--surface-chip); display: none; }
.eyebrow { font-size: 15px; font-weight: 700; color: var(--accent-text); }
.login-card h1 { font-size: 30px; font-weight: 900; line-height: 1.3; }
.login-hint { color: var(--text-muted); font-size: 15.5px; margin: 6px 0 22px; }

.login-error {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: 14px; font-size: 15px; font-weight: 700;
  background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}

#loginForm .field { margin-bottom: 18px; animation: fadeInUp .5s var(--ease) both; }
#loginForm .field:nth-of-type(1) { animation-delay: .25s; }
#loginForm .field:nth-of-type(2) { animation-delay: .32s; }
.input-wrap { position: relative; }
.input-wrap .lead { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-soft); display: grid; transition: color .2s ease; pointer-events: none; }
/* Physical sides on purpose: the icon sits on the page's right (RTL) even in the left-to-right email field. */
.input-wrap .form-control { min-height: 54px; padding-right: 46px; padding-left: 14px; font-size: 16px; border-radius: 14px; }
.input-wrap .form-control#Password { padding-left: 52px; }
.input-wrap:focus-within .lead { color: var(--accent-text); }
.reveal { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 10px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; }
.reveal:hover { background: var(--surface-sunken); color: var(--text-strong); }
.reveal .i-hide, .reveal[aria-pressed="true"] .i-show { display: none; }
.reveal[aria-pressed="true"] .i-hide { display: block; }
.caps { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--warning); animation: fadeIn .2s ease both; }
#loginSubmit { min-height: 54px; font-size: 17px; border-radius: 14px; margin-top: 4px; animation: fadeInUp .5s var(--ease) .4s both; }
#loginSubmit .flip { transform: scaleX(-1); transition: transform .25s var(--ease); }
#loginSubmit:hover .flip { transform: scaleX(-1) translateX(4px); }

.login-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--surface-line); font-size: 14.5px; }
.login-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 700; }
.login-foot a:hover { color: var(--accent-text); }
.theme-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--surface-line); background: var(--surface-sunken); color: var(--text-strong); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.theme-pill .i-sun { display: none; }
:root[data-theme="dark"] .theme-pill .i-sun { display: inline; }
:root[data-theme="dark"] .theme-pill .i-moon { display: none; }
/* the button shares #themeToggle with the dashboard (for the theme script), whose rules show icons as blocks */
:root[data-theme="dark"] #themeToggle.theme-pill span.i-sun { display: inline; }
.copyright { font-size: 13.5px; color: var(--text-soft); }

/* ---------- phones: the brand panel becomes a compact header ---------- */
@media (max-width: 920px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand-panel { padding: 30px 20px 64px; }
  .brand-mark { width: 150px; height: 150px; margin-bottom: 0; }
  .brand-mark img { width: 112px; height: 112px; }
  .brand-mark .halo { width: 130px; height: 130px; }
  .brand-mark .orbit.or1 { width: 134px; height: 134px; }
  .brand-mark .orbit.or2 { width: 152px; height: 152px; }
  .brand-inner h2 { font-size: 24px; }
  .brand-inner p, .brand-chips { display: none; }
  .login-main { margin-top: -44px; padding-block: 0 28px; align-content: start; background: transparent; }
  .login-card { padding: 28px 22px 20px; }
}
