/* Opening sequence and continuous heartbeat, scoped to the login screen. */
#loginView.login-shell {
  position: relative; isolation: isolate; min-height: 100dvh;
  padding: 32px 20px 70px; overflow: hidden;
  background: #e9eef5 url("assets/background25.jpg") center / cover;
}
#loginView::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(233,240,248,.92);
}
#loginView .login-card {
  display: grid; grid-template-columns: 1fr; width: min(470px, 100%);
  border: 1px solid #fff; border-radius: 8px; overflow: hidden;
  background: #fff; box-shadow: 0 24px 80px #16343c24;
}
#loginView .brand-panel {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 32px 0; background: #fff; text-align: center;
}
#loginView .brand-panel::before, #loginView .brand-kicker,
#loginView .brand-slogan { display: none; }
#loginView .brand-logo {
  width: 180px; height: 108px; object-fit: contain; margin: 0 0 12px;
  filter: none; background: transparent;
}
#loginView .brand-panel h1 { font-size: 18px; line-height: 1.4; margin: 0; color: #263b43; }
#loginView .pulse-strip { width: 100%; height: 44px; margin: 10px 0 0; }
#loginView .pulse-strip svg { width: 100%; height: 100%; }
#loginView .pulse-line, #loginView .pulse-glow {
  stroke: #e5b346; stroke-dasharray: 110 490; stroke-dashoffset: 600;
  animation: opHeartbeatTrace 2.4s linear infinite;
}
#loginView .pulse-glow { stroke-width: 9; opacity: .2; }
#loginView .login-form { padding: 14px 36px 32px; gap: 15px; background: #fff; color: #263b43; }
#loginView .login-form-heading h2 { font-size: 24px; text-align: center; margin: 0; color: #172e35; }
#loginView .login-form-heading p { display: none; }
#loginView .login-form label { color: #344b53; font-size: 13px; }
#loginView .login-form input, #loginView .login-form select {
  min-height: 48px; background: #f5f8f9; color: #16313b; border: 1px solid #cad8de; border-radius: 6px;
}
#loginView .login-input-wrap input { padding-left: 42px; }
#loginView .login-input-icon { stroke: var(--blue); }
#loginView .login-form input:focus, #loginView .login-form select:focus {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
#loginView .license-status { color: #536972; }
#loginView .form-message { color: #b42338; min-height: 0; margin: 0; }
#loginView .login-submit-button {
  width: 100%; min-height: 50px; border-radius: 6px; color: #fff;
  background: var(--blue); box-shadow: 0 8px 18px rgba(46,126,203,.2);
  transition: transform .2s, background .2s;
}
#loginView .login-submit-button:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--blue) 85%, #000); }
.login-opening {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-content: center; justify-items: center; gap: 24px;
  background: #0a1624; color: #fff; pointer-events: none; overflow: hidden;
}
.login-opening-logo { width: 270px; padding: 22px; border-radius: 8px; background: #fff; }
.login-opening-logo img { display: block; width: 100%; height: 150px; object-fit: contain; }
.login-opening-pulse { width: min(960px, 94vw); height: 150px; overflow: visible; }
.login-opening-line, .login-opening-glow {
  fill: none; stroke: #e5b346; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 760; stroke-dashoffset: 760;
}
.login-opening-glow { stroke-width: 12; opacity: .35; filter: blur(5px); }
.login-opening > span { font-size: 16px; color: #e9d6ab; text-align: center; padding: 0 20px; }
#loginView.login-enter .login-opening { display: grid; animation: opCurtain 3.6s cubic-bezier(.65,0,.2,1) forwards; }
.login-enter .login-opening-logo { animation: opLogoBeat 2.8s ease both; }
.login-enter .login-opening-line, .login-enter .login-opening-glow { animation: opOpeningTrace 2.4s ease .25s both; }
.login-enter .login-opening > span { animation: opRise .7s ease .5s both; }
#loginView.login-enter .login-card { animation: opFormReveal 1s cubic-bezier(.16,1,.3,1) 2.8s both; }
.login-enter .login-form > * { animation: opRise .7s ease 3.15s both; }
.login-enter .login-form > label:nth-of-type(3) { animation-delay: 3.3s; }
.login-enter .login-form > label:nth-of-type(4) { animation-delay: 3.4s; }
.login-enter .login-actions { animation-delay: 3.5s; }
@keyframes opOpeningTrace { 0% { stroke-dashoffset: 760; } 100% { stroke-dashoffset: 0; } }
@keyframes opHeartbeatTrace { to { stroke-dashoffset: 0; } }
@keyframes opLogoBeat {
  0% { opacity: 0; transform: scale(.65); filter: blur(12px); }
  22% { opacity: 1; transform: scale(1); filter: blur(0); }
  38%, 60% { transform: scale(1); box-shadow: 0 0 0 0 #e5b34600; }
  43%, 65% { transform: scale(1.1); box-shadow: 0 0 60px 8px #e5b34655; }
  48%, 70%, 100% { transform: scale(1); box-shadow: 0 0 0 0 #e5b34600; }
}
@keyframes opCurtain {
  0%, 76% { clip-path: inset(0); opacity: 1; visibility: visible; }
  99% { clip-path: inset(0 0 100% 0); opacity: 1; visibility: visible; }
  100% { clip-path: inset(0 0 100% 0); opacity: 0; visibility: hidden; }
}
@keyframes opFormReveal { from { opacity: 0; transform: translateY(90px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes opRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  #loginView.login-shell { padding: 18px 14px 65px; }
  #loginView .brand-panel { padding: 20px 24px 0; }
  #loginView .login-form { padding: 12px 24px 26px; }
  .login-opening-logo { width: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  #loginView.login-enter .login-opening { animation-name: opGentleOpening; }
  .login-enter .login-opening-logo { animation: opGentleAppear .8s ease both; }
  #loginView.login-enter .login-card { animation-name: opGentleAppear; }
  .login-enter .login-form > *, .login-enter .login-opening > span { animation-name: opGentleAppear; }
  #loginView .login-submit-button:hover { transform: none; }
}
@keyframes opGentleOpening { 0%, 76% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes opGentleAppear { from { opacity: 0; } to { opacity: 1; } }

/* Event selection is a later interaction, not part of the opening sequence. */
#loginView.login-enter .login-form > label.login-event-selection {
  animation: opGentleAppear .2s ease both;
}
body.light-theme #loginView .login-opening { background: #e9f0f8; }
body.light-theme #loginView .login-opening > span { color: #725419; }
body:not(.light-theme) #loginView::before { background: var(--surface); }
body:not(.light-theme) #loginView .login-card {
  background: var(--panel); border-color: var(--line); box-shadow: 0 24px 80px #0006;
}
body:not(.light-theme) #loginView .brand-panel,
body:not(.light-theme) #loginView .login-form { background: var(--panel); color: var(--ink); }
body:not(.light-theme) #loginView .brand-panel h1,
body:not(.light-theme) #loginView .login-form-heading h2,
body:not(.light-theme) #loginView .login-form label { color: #e7eff3; }
body:not(.light-theme) #loginView .brand-logo {
  filter: drop-shadow(0 0 5px #e5b346aa) drop-shadow(0 0 14px #e5b34644);
}
body:not(.light-theme) #loginView .login-form input,
body:not(.light-theme) #loginView .login-form select {
  background: var(--panel-2); color: var(--ink); border-color: var(--line);
}
body:not(.light-theme) #loginView .login-form input::placeholder { color: #a7bbc7; }
body:not(.light-theme) #loginView .login-input-icon { stroke: var(--blue); }
body:not(.light-theme) #loginView .license-status { color: #acc4ce; }
body:not(.light-theme) #loginView .form-message { color: #ffabb2; }
