/* ==========================================================================
   Berriz Vote Bot - Modern Ultra-Glossy SaaS Design System
   Linear / Raycast / Vercel / Stripe High-End Dark Glass Architecture
   Accent: Electric Indigo & Hyper-Cyan Lighting (Zero Pink)
   ========================================================================== */

:root {
  /* Ultra-Deep Background Canvas */
  --bg-base: #06080E;
  --bg-surface: rgba(13, 17, 28, 0.72);
  --bg-elevated: rgba(20, 26, 42, 0.82);
  --bg-card: rgba(15, 20, 34, 0.65);
  --bg-card-hover: rgba(22, 30, 52, 0.85);

  /* Micro Glass Borders (Subtle Top Lighting) */
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-bright: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(99, 102, 241, 0.45);

  /* Typography */
  --text-ink: #F8FAFC;
  --text-dim: #94A3B8;
  --text-muted: #64748B;

  /* Accent: Electric Indigo / Modern Violet */
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-active: #4338CA;
  --accent-subtle: rgba(99, 102, 241, 0.14);
  --accent-glow: rgba(99, 102, 241, 0.35);

  /* Semantics */
  --ok: #10B981;
  --ok-subtle: rgba(16, 185, 129, 0.14);
  --warn: #F59E0B;
  --warn-subtle: rgba(245, 158, 11, 0.14);
  --err: #EF4444;
  --err-subtle: rgba(239, 68, 68, 0.16);
  --info: #06B6D4;
  --info-subtle: rgba(6, 182, 212, 0.14);

  /* Glossy Lighting & Multi-layered Refraction */
  --gloss-top: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  --shadow-gloss: inset 0 1px 0 0 rgba(255, 255, 255, 0.14), 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px -4px var(--accent-glow);
  --shadow-card: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 24px 48px -12px rgba(0, 0, 0, 0.75);
}

body {
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-ink);
  letter-spacing: -0.012em;
  background-image: 
    radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(circle at 90% 10%, rgba(6, 182, 212, 0.1), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(99, 102, 241, 0.08), transparent 50%);
  background-attachment: fixed;
}

/* ==========================================================================
   Ultra-Glossy Card Surfaces
   ========================================================================== */

.glass-panel {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-card);
}
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.02) 60%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-panel-elevated {
  position: relative;
  background: var(--bg-elevated);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.18), 0 30px 60px -15px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   Login Experience (Ultra Glossy Split Scene)
   ========================================================================== */

.login-scene {
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 10%, rgba(99, 102, 241, 0.2), transparent 55%), #06080E;
}

.login-orb {
  position: absolute;
  z-index: -1;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.3;
  pointer-events: none;
}
.login-orb-one { top: -200px; left: 10%; background: #6366F1; }
.login-orb-two { right: -150px; bottom: -200px; background: #06B6D4; }

.login-shell {
  background: rgba(13, 17, 28, 0.85);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    0 40px 100px -25px rgba(0, 0, 0, 0.9),
    0 0 50px -10px rgba(99, 102, 241, 0.2);
}

.login-showcase {
  background: 
    radial-gradient(circle at 60% 40%, rgba(99, 102, 241, 0.3), transparent 55%),
    linear-gradient(155deg, rgba(20, 26, 44, 0.92) 0%, rgba(11, 15, 25, 0.98) 70%, rgba(6, 8, 14, 0.99) 100%);
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
}

.login-art {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 330px;
  height: 330px;
  transform: translate(-50%, -55%);
  display: grid;
  place-items: center;
}

.login-art-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: inset 0 0 60px rgba(99, 102, 241, 0.06), 0 0 60px rgba(99, 102, 241, 0.05);
}
.ring-a { inset: 12px; border-style: dashed; animation: fx-spin 60s linear infinite; }
.ring-b { inset: 56px; border-color: rgba(99, 102, 241, 0.35); }

.login-art-core {
  display: grid;
  width: 122px;
  height: 122px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 38px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #818CF8 0%, #4F46E5 100%);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 24px 60px rgba(99, 102, 241, 0.5);
  transform: rotate(-6deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.login-art-core:hover {
  transform: rotate(0deg) scale(1.05);
}
.login-art-core svg { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35)); }

.art-spark { position: absolute; color: #C7D2FE; text-shadow: 0 0 24px rgba(99, 102, 241, 0.95); }
.spark-a { top: 30px; right: 50px; font-size: 26px; animation: dot-pulse 3s infinite ease-in-out; }
.spark-b { bottom: 40px; left: 45px; font-size: 32px; animation: dot-pulse 2.5s infinite ease-in-out 0.5s; }
.spark-c { top: 90px; left: 22px; font-size: 17px; animation: dot-pulse 3.5s infinite ease-in-out 1s; }

.login-gradient-text {
  background: linear-gradient(110deg, #FFFFFF 15%, #C7D2FE 55%, #818CF8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-form-panel {
  background: linear-gradient(145deg, rgba(16, 21, 34, 0.96), rgba(9, 12, 20, 0.98));
}

.login-input-wrap { position: relative; }
.login-input-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  color: var(--text-dim);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 0.2s;
}

.login-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px 12px 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  outline: none;
  color: var(--text-ink);
  background: rgba(6, 9, 15, 0.75);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.login-input::placeholder { color: var(--text-muted); }
.login-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(8, 12, 19, 0.9);
}
.login-input:focus {
  border-color: var(--accent);
  background: rgba(12, 16, 26, 0.98);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(99, 102, 241, 0.22);
}
.login-input:focus + .login-input-icon,
.login-input-wrap:focus-within .login-input-icon {
  color: var(--accent);
}

/* ==========================================================================
   Ultra-Glossy Frosted Transparent Glass Button
   Apple Vision Pro / Linear / Stripe Inspired Transparent Crystal Glass
   ========================================================================== */

.login-submit {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* Semi-transparent frosted glass base */
  background: linear-gradient(
    135deg, 
    rgba(99, 102, 241, 0.42) 0%, 
    rgba(79, 70, 229, 0.28) 45%, 
    rgba(14, 18, 30, 0.55) 100%
  ) !important;
  backdrop-filter: blur(24px) saturate(220%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(220%) !important;
  /* Ultra-crisp crystal borders */
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-top-color: rgba(255, 255, 255, 0.65) !important;
  border-bottom-color: rgba(99, 102, 241, 0.35) !important;
  border-radius: 16px !important;
  color: #FFFFFF !important;
  font-weight: 600;
  cursor: pointer;
  transform: translateZ(0);
  /* Multi-depth refraction & ambient glow */
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.4),
    inset 0 0 16px rgba(99, 102, 241, 0.3),
    0 12px 32px -8px rgba(0, 0, 0, 0.65),
    0 6px 20px -2px rgba(99, 102, 241, 0.4) !important;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              background 0.25s ease, 
              border-color 0.25s ease !important;
}

/* Crystal prism light sweep */
.login-submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.38) 50%, 
    transparent 100%
  );
  transform: skewX(-25deg);
  transition: left 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Glass lens internal reflection */
.login-submit::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 8%;
  right: 8%;
  height: 48%;
  border-radius: 9999px;
  background: linear-gradient(
    180deg, 
    rgba(255, 255, 255, 0.35) 0%, 
    rgba(255, 255, 255, 0.03) 100%
  );
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.login-submit:hover {
  background: linear-gradient(
    135deg, 
    rgba(129, 140, 248, 0.55) 0%, 
    rgba(99, 102, 241, 0.38) 45%, 
    rgba(20, 26, 44, 0.65) 100%
  ) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  border-top-color: #FFFFFF !important;
  box-shadow: 
    inset 0 1px 0 0 #FFFFFF,
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.45),
    inset 0 0 24px rgba(99, 102, 241, 0.45),
    0 16px 40px -8px rgba(0, 0, 0, 0.75),
    0 8px 30px 0px rgba(99, 102, 241, 0.65) !important;
  transform: translateY(-2px) !important;
}

.login-submit:hover::before {
  left: 200%;
}

.login-submit:hover::after {
  opacity: 1;
}

/* Click / Active Mechanical Feedback */
.login-submit:active {
  background: linear-gradient(
    135deg, 
    rgba(67, 56, 202, 0.5) 0%, 
    rgba(49, 46, 129, 0.6) 100%
  ) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 
    inset 0 2px 6px 0 rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
    0 4px 12px rgba(99, 102, 241, 0.35) !important;
  transform: translateY(2px) scale(0.975) !important;
}

.login-submit:active::after {
  opacity: 0.25;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header-nav-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-badges {
  margin-left: auto;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-nav-btn {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 24, 38, 0.65);
  backdrop-filter: blur(16px);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.header-nav-btn:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--text-ink);
  background: rgba(26, 35, 56, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 14px rgba(0, 0, 0, 0.25);
  transform: translateY(-0.5px);
}
.header-nav-btn:active {
  transform: scale(0.97);
}

/* ==========================================================================
   Account Forms & Mode Switchers
   ========================================================================== */

#account-management-section {
  padding: clamp(20px, 2.4vw, 32px);
}
.account-mode-switch {
  background: rgba(8, 11, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}
#account-mode-password, #account-mode-token {
  min-height: 38px;
  border-radius: 9px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#account-form {
  row-gap: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(16, 22, 36, 0.75), rgba(10, 13, 22, 0.88));
  backdrop-filter: blur(20px);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 36px rgba(0, 0, 0, 0.35);
}
#account-form > div:not(.hidden) > input,
#account-form > div:not(.hidden) > textarea {
  display: block;
}
#account-token-json-field textarea {
  min-height: 148px;
  line-height: 1.8;
}
#account-token-help {
  max-width: 820px;
}

#btn-add-account {
  position: relative;
  background: linear-gradient(180deg, #6366F1 0%, #4F46E5 100%);
  color: #FFFFFF !important;
  font-weight: 600;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 6px 22px rgba(99, 102, 241, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
}
#btn-add-account:hover {
  background: linear-gradient(180deg, #7175F3 0%, #5B54E8 100%);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 30px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}
#btn-add-account:active {
  transform: scale(0.975);
}

/* ==========================================================================
   Terminal Window (High-End IDE Aesthetic)
   ========================================================================== */

.terminal {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 1.75;
  min-height: 0;
  overscroll-behavior: auto;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  background: #030508;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.8);
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}
.log-line:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.log-ts {
  color: var(--text-dim);
  opacity: 0.6;
  margin-right: 10px;
  font-size: 11px;
}

.log-lvl {
  margin-right: 10px;
  font-weight: 600;
  font-size: 11px;
  padding: 1.5px 7px;
  border-radius: 5px;
}

.lvl-info {
  color: #06B6D4;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.lvl-ok {
  color: #10B981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.lvl-warn {
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.lvl-error {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

/* ==========================================================================
   Certificates Download UX
   ========================================================================== */

.cert-download-btn {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cert-download-btn:not(:disabled):hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}
.cert-download-btn:disabled {
  cursor: wait;
}
.cert-download-busy {
  color: #FFFFFF !important;
  background: linear-gradient(105deg, #4338CA, #6366F1, #4338CA) !important;
  background-size: 200% 100% !important;
  animation: cert-download-shimmer 1.5s ease-in-out infinite;
}
.cert-download-spinner {
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: fx-spin 0.7s linear infinite;
}
.cert-download-done {
  color: #042A1D !important;
  background: #10B981 !important;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4);
}
.cert-download-check {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  color: #042A1D;
  background: rgba(4, 42, 29, 0.15);
}
.cert-download-failed {
  color: #FFFFFF !important;
  background: #EF4444 !important;
}

@keyframes cert-download-shimmer {
  to { background-position: -200% 0; }
}

/* ==========================================================================
   Animation Keyframes & Utilities
   ========================================================================== */

.dot-pulse {
  animation: dot-pulse 1.8s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 6px var(--ok)); }
  50% { opacity: 0.35; transform: scale(0.85); filter: drop-shadow(0 0 0 transparent); }
}

.skeleton {
  background: linear-gradient(100deg, #0C101A 40%, #172033 50%, #0C101A 60%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fx-spin {
  animation: fx-spin 0.7s linear infinite;
}
@keyframes fx-spin {
  to { transform: rotate(360deg); }
}

.btn-spinner {
  display: inline-block;
  vertical-align: -0.15em;
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 9999px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  opacity: 0.95;
  animation: fx-spin 0.7s linear infinite;
}
.btn-spinner.hidden {
  display: none !important;
}
.btn-spinner-sm {
  width: 11px;
  height: 11px;
  border-width: 1.8px;
}
.btn-busy,
.btn-busy-sm {
  cursor: default;
}

.btn-state-ok.bg-accent {
  background-color: var(--ok) !important;
  background-image: none !important;
}
.btn-state-ok {
  border-color: var(--ok) !important;
  color: var(--ok) !important;
}
.btn-state-err.bg-accent {
  background-color: var(--err) !important;
  background-image: none !important;
}
.btn-state-err {
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: var(--err) !important;
}

.btn-check path {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: btn-check-draw 0.4s 0.05s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes btn-check-draw {
  to { stroke-dashoffset: 0; }
}

.btn-label-swap > span {
  animation: fx-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-fx {
  animation: card-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-fx > * {
  animation: fx-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.auth-fx > *:nth-child(2) {
  animation-delay: 0.08s;
}

@keyframes card-pop {
  0% { opacity: 0; transform: scale(0.96) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fx-rise {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.shaking {
  animation: fx-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes fx-shake {
  10%, 90% { transform: translateX(-1.5px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.err-in {
  animation: err-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes err-pop {
  0% { opacity: 0; transform: translateY(-4px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Dashboard Universal Glossy Transparent Buttons (Apple Glass / Linear Style)
   ========================================================================== */

/* ==========================================================================
   Universal Ultra-Glossy Transparent Button System (All Pages)
   ========================================================================== */

/* Primary Glossy Transparent Action Buttons (Start, Save, Add, Register, Create, Sync, Per-Account Start Vote) */
#btn-start,
#btn-save-config,
#btn-add-account,
#btn-register-start,
#create-web-user-button,
#btn-save-register-config,
#btn-save-proxy,
#btn-save-vote-proxy,
#refresh,
.account-vote-start {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(
    135deg, 
    rgba(99, 102, 241, 0.45) 0%, 
    rgba(79, 70, 229, 0.3) 50%, 
    rgba(15, 20, 35, 0.6) 100%
  ) !important;
  backdrop-filter: blur(20px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-top-color: rgba(255, 255, 255, 0.65) !important;
  border-bottom-color: rgba(99, 102, 241, 0.35) !important;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.4),
    inset 0 0 18px rgba(99, 102, 241, 0.25),
    0 8px 24px -4px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(99, 102, 241, 0.35) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.2s ease,
              border-color 0.2s ease !important;
}

#btn-start::after,
#btn-save-config::after,
#btn-add-account::after,
#btn-register-start::after,
#create-web-user-button::after,
#btn-save-register-config::after,
#btn-save-proxy::after,
#btn-save-vote-proxy::after,
#refresh::after,
.account-vote-start::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 8%;
  right: 8%;
  height: 42%;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
  opacity: 0.85;
}

#btn-start:not(:disabled):hover,
#btn-save-config:not(:disabled):hover,
#btn-add-account:not(:disabled):hover,
#btn-register-start:not(:disabled):hover,
#create-web-user-button:not(:disabled):hover,
#btn-save-register-config:not(:disabled):hover,
#btn-save-proxy:not(:disabled):hover,
#btn-save-vote-proxy:not(:disabled):hover,
#refresh:not(:disabled):hover,
.account-vote-start:not(:disabled):hover {
  background: linear-gradient(
    135deg, 
    rgba(129, 140, 248, 0.58) 0%, 
    rgba(99, 102, 241, 0.42) 50%, 
    rgba(22, 28, 48, 0.7) 100%
  ) !important;
  border-top-color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 
    inset 0 1px 0 0 #FFFFFF,
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.4),
    inset 0 0 24px rgba(99, 102, 241, 0.4),
    0 12px 32px -4px rgba(0, 0, 0, 0.6),
    0 6px 24px rgba(99, 102, 241, 0.55) !important;
  transform: translateY(-1.5px) !important;
}

#btn-start:not(:disabled):active,
#btn-save-config:not(:disabled):active,
#btn-add-account:not(:disabled):active,
#btn-register-start:not(:disabled):active,
#create-web-user-button:not(:disabled):active,
#btn-save-register-config:not(:disabled):active,
#btn-save-proxy:not(:disabled):active,
#btn-save-vote-proxy:not(:disabled):active,
#refresh:not(:disabled):active,
.account-vote-start:not(:disabled):active {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.5) 0%, rgba(49, 46, 129, 0.65) 100%) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 
    inset 0 2px 6px 0 rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
    0 2px 8px rgba(99, 102, 241, 0.3) !important;
  transform: translateY(1.5px) scale(0.98) !important;
}

/* Per-account Start Vote Button in Account List Table & Cards */
.account-vote-start {
  min-height: 34px !important;
  padding: 6px 14px !important;
  font-size: 11px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.account-vote-start:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  background: rgba(20, 26, 42, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  border-top-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: none !important;
  color: var(--text-dim) !important;
  transform: none !important;
}

/* Details dropdown trigger button in accounts table */
.account-actions-menu summary {
  background: rgba(18, 24, 38, 0.6) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  transition: all 0.15s ease !important;
}

.account-actions-menu summary:hover {
  background: rgba(25, 33, 52, 0.8) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  color: var(--text-ink) !important;
}

.account-actions-menu summary:active {
  transform: scale(0.97) !important;
}

/* Secondary Glossy Transparent Action Buttons */
#btn-load-options,
#btn-close-options,
#btn-reload-logs,
#btn-clear-logs,
#btn-backup-accounts,
#btn-refresh-account-votes,
#btn-reload-runs,
#btn-delete-all-accounts,
#btn-copy-terminal,
#btn-clear-terminal,
#btn-download-backup,
#btn-copy-results,
#btn-copy-new-results,
#btn-reload-monitoring,
#btn-test-provider,
#btn-test-proxy,
#btn-test-vote-proxy,
#btn-sync-vote-proxy,
#reload-web-users,
#admin-logout,
#back-nav,
.header-nav-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.02) 100%
  ), rgba(18, 24, 38, 0.55) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18),
    0 4px 12px -2px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#btn-load-options:not(:disabled):hover,
#btn-reload-logs:not(:disabled):hover,
#btn-backup-accounts:not(:disabled):hover,
#btn-refresh-account-votes:not(:disabled):hover,
#btn-reload-runs:not(:disabled):hover,
#btn-copy-terminal:not(:disabled):hover,
#btn-download-backup:not(:disabled):hover,
#btn-copy-results:not(:disabled):hover,
#btn-copy-new-results:not(:disabled):hover,
#btn-reload-monitoring:not(:disabled):hover,
#btn-test-provider:not(:disabled):hover,
#btn-test-proxy:not(:disabled):hover,
#btn-test-vote-proxy:not(:disabled):hover,
#btn-sync-vote-proxy:not(:disabled):hover,
#reload-web-users:not(:disabled):hover,
#back-nav:hover,
.header-nav-btn:hover {
  background: linear-gradient(
    180deg, 
    rgba(99, 102, 241, 0.2) 0%, 
    rgba(99, 102, 241, 0.08) 100%
  ), rgba(24, 32, 52, 0.75) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  border-top-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.35),
    0 6px 18px -2px rgba(99, 102, 241, 0.25) !important;
  transform: translateY(-1px) !important;
}

#btn-close-options:not(:disabled):hover,
#btn-clear-logs:not(:disabled):hover,
#btn-delete-all-accounts:not(:disabled):hover,
#btn-clear-terminal:not(:disabled):hover,
#admin-logout:hover {
  background: linear-gradient(
    180deg, 
    rgba(239, 68, 68, 0.18) 0%, 
    rgba(239, 68, 68, 0.05) 100%
  ), rgba(30, 18, 25, 0.75) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  border-top-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
    0 6px 18px -2px rgba(239, 68, 68, 0.25) !important;
  transform: translateY(-1px) !important;
}

#btn-load-options:not(:disabled):active,
#btn-close-options:not(:disabled):active,
#btn-reload-logs:not(:disabled):active,
#btn-clear-logs:not(:disabled):active,
#btn-backup-accounts:not(:disabled):active,
#btn-refresh-account-votes:not(:disabled):active,
#btn-reload-runs:not(:disabled):active,
#btn-delete-all-accounts:not(:disabled):active,
#btn-copy-terminal:not(:disabled):active,
#btn-clear-terminal:not(:disabled):active,
#btn-download-backup:not(:disabled):active,
#btn-copy-results:not(:disabled):active,
#btn-copy-new-results:not(:disabled):active,
#btn-reload-monitoring:not(:disabled):active,
#btn-test-provider:not(:disabled):active,
#btn-test-proxy:not(:disabled):active,
#btn-test-vote-proxy:not(:disabled):active,
#btn-sync-vote-proxy:not(:disabled):active,
#reload-web-users:not(:disabled):active,
#admin-logout:active,
#back-nav:active,
.header-nav-btn:active {
  background: rgba(14, 18, 30, 0.85) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
  transform: translateY(1px) scale(0.975) !important;
}

/* Stop Button Glossy Transparent Danger */
#btn-stop:not(:disabled) {
  background: linear-gradient(
    135deg, 
    rgba(239, 68, 68, 0.35) 0%, 
    rgba(185, 28, 28, 0.2) 50%, 
    rgba(25, 12, 16, 0.6) 100%
  ) !important;
  backdrop-filter: blur(18px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-top-color: rgba(255, 255, 255, 0.55) !important;
  border-bottom-color: rgba(239, 68, 68, 0.35) !important;
  color: #F87171 !important;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
    0 6px 20px -2px rgba(239, 68, 68, 0.35) !important;
}

#btn-stop:not(:disabled):hover {
  background: linear-gradient(
    135deg, 
    rgba(248, 113, 113, 0.45) 0%, 
    rgba(220, 38, 38, 0.3) 50%, 
    rgba(35, 14, 20, 0.7) 100%
  ) !important;
  border-top-color: #FFFFFF !important;
  box-shadow: 
    inset 0 1px 0 0 #FFFFFF,
    0 10px 28px -2px rgba(239, 68, 68, 0.5) !important;
  transform: translateY(-1.5px) !important;
}

#btn-stop:not(:disabled):active {
  transform: translateY(1.5px) scale(0.98) !important;
}

/* Segmented and Preset Buttons */
.btn-time-preset {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  transition: all 0.15s ease !important;
}
.btn-time-preset:active {
  transform: scale(0.96) !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.7);
  outline-offset: 2px;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

@media (max-width: 639px) {
  body { overflow-x: hidden; }
  .header-nav-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.6rem 0.75rem;
    padding: 0.7rem 0.85rem;
  }
  .header-brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .header-badges {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    min-width: 0;
  }
  .header-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: flex;
    gap: 0.4rem;
  }
  .header-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-nav-btn.hidden,
  .header-nav-btn[hidden] {
    display: none !important;
  }
  #dashboard > main { width: 100%; gap: 0.85rem; padding: 0.85rem; }
  #dashboard main > section { min-width: 0; border-radius: 1.25rem; padding: 1.1rem; }
  #account-management-section .account-mode-switch { display: flex; width: 100%; }
  #account-management-section .account-mode-switch button { flex: 1 1 0; min-width: 0; padding-inline: 0.55rem; white-space: nowrap; }
  #terminal-section { height: 380px; }
  #terminal-section > div:first-child { align-items: flex-start; gap: 0.6rem; }
  #terminal-section > div:first-child > div:last-child { flex-shrink: 0; }
  #terminal-section > div:first-child > div:last-child button { width: 2.25rem; height: 2.25rem; padding: 0; font-size: 0; }
  #terminal-section > div:first-child > div:last-child button svg { margin: 0; }
  #account-vote-section .grid.grid-cols-2 > div { min-width: 0; }
  #account-vote-section .grid.grid-cols-2 > div > div:first-child { min-height: 2rem; }
  #certificates-section .flex.rounded-lg { width: 100%; }
  #certificates-section .flex.rounded-lg button { flex: 1 1 0; min-width: 0; padding-inline: 0.45rem; white-space: nowrap; }
  #account-form { padding: 18px; row-gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-fx,
  .auth-fx > *,
  .shaking,
  .err-in,
  .btn-label-swap > span,
  .btn-check path,
  .dot-pulse,
  .skeleton,
  .login-input,
  .login-submit,
  .cert-download-btn,
  .cert-download-busy,
  .cert-download-spinner {
    animation: none !important;
    transition: none !important;
  }
  .btn-check path {
    stroke-dashoffset: 0;
  }
}
