/* GlowAuth UI refresh: restore the original violet/blue identity and make interactions feel consistent. */
:root {
  --ui-motion: cubic-bezier(.2,.75,.25,1);
  --ui-surface: rgba(16, 18, 31, .96);
  --ui-border: rgba(166, 149, 255, .17);
  --ui-border-hover: rgba(166, 149, 255, .38);
  --ui-focus: rgba(156, 124, 255, .56);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

body {
  background-color: var(--bg, #07080e);
  -webkit-tap-highlight-color: transparent;
}

/* Uniform transitions across controls, surfaces, and links. */
button,
input,
textarea,
select,
a,
.card,
.metric-grid article,
.dashboard-tab,
.file-row,
.saved-panel-row,
.panel-key-row,
.published-panel-preview,
.drop-zone,
.obf-choice-card,
.login-card,
.login-showcase,
.execution-stat-card,
.dashboard-home-card,
.controls-summary-card,
.controls-settings-card {
  transition-property: color, background-color, border-color, box-shadow, opacity, transform, filter;
  transition-duration: .2s;
  transition-timing-function: var(--ui-motion);
}

button,
.primary-btn,
.secondary-btn,
.logout-btn,
.google-button,
.github-button,
.dashboard-tab,
.mobile-tabs-toggle,
.file-row-actions button,
.file-row-actions a,
.saved-panel-actions button,
.link-box button,
.source-editor-footer button,
.tab-button,
.action-button,
.panel-loader-box button,
.credits-back {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:hover:not(:disabled),
.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.logout-btn:hover:not(:disabled),
.file-row-actions button:hover:not(:disabled),
.file-row-actions a:hover,
.saved-panel-actions button:hover:not(:disabled),
.link-box button:hover:not(:disabled),
.source-editor-footer button:hover:not(:disabled),
.panel-loader-box button:hover:not(:disabled) {
  filter: brightness(1.08);
}

button:active:not(:disabled),
.primary-btn:active:not(:disabled),
.secondary-btn:active:not(:disabled),
.logout-btn:active:not(:disabled),
.google-button:active,
.github-button:active,
.dashboard-tab:active,
.mobile-tabs-toggle:active,
.file-row-actions button:active:not(:disabled),
.saved-panel-actions button:active:not(:disabled),
.link-box button:active:not(:disabled),
.source-editor-footer button:active:not(:disabled) {
  transform: scale(.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 3px;
}

input,
textarea,
select {
  accent-color: var(--accent, #9c7cff);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(156, 124, 255, .55);
}

/* The sticky mobile header is opaque and flush to the viewport, so scrolling text
   cannot peek above or through its rounded top corners. */
@media (max-width: 700px) {
  .dashboard-shell {
    padding-top: 0 !important;
  }

  .dashboard-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 160 !important;
    isolation: isolate;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    border: 1px solid rgba(166, 149, 255, .22) !important;
    border-top: 0 !important;
    border-radius: 0 0 16px 16px !important;
    background: linear-gradient(145deg, rgba(20, 21, 38, .995), rgba(9, 11, 21, .995)) !important;
    background-clip: padding-box;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .27), inset 0 1px 0 rgba(255, 255, 255, .035) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: visible !important;
  }

  .dashboard-header .mobile-tabs-toggle {
    border-color: rgba(166, 149, 255, .26) !important;
    background: linear-gradient(145deg, rgba(134, 111, 255, .14), rgba(75, 112, 255, .08)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  }

  .dashboard-header .mobile-tabs-toggle:active {
    transform: scale(.97);
  }

  #dashboardNav {
    z-index: 170 !important;
  }

  .mobile-nav-scrim:not(.hidden) {
    z-index: 165 !important;
  }

  .obf-choice-card {
    gap: 13px;
    border-color: rgba(158, 132, 255, .24);
    background: radial-gradient(ellipse at 0% 0%, rgba(118, 92, 255, .13), transparent 57%), linear-gradient(145deg, rgba(19, 18, 35, .97), rgba(11, 12, 22, .98));
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  }

  .obf-options {
    min-width: 0;
    padding: 13px 0 0;
    border: 0;
    border-top: 1px solid rgba(166, 149, 255, .13);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .obf-profile-note {
    padding: 11px 12px;
    border-color: rgba(166, 149, 255, .15);
    border-radius: 12px;
    background: rgba(137, 117, 255, .045);
  }

  .obf-service-note {
    font-size: .68rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  #toast,
  .toast {
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 24px) !important;
    padding: 11px 14px !important;
    border-radius: 13px !important;
    font-size: .72rem !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .36) !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  .card:hover,
  .dashboard-home-card:hover,
  .execution-stat-card:hover,
  .controls-summary-card:hover {
    border-color: var(--ui-border-hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Keep touch controls animated too; an earlier performance rule disabled these. */
@media (pointer: coarse), (max-width: 700px) {
  .dashboard-tab,
  .mobile-tabs-toggle,
  .control-switch,
  .script-control-item *,
  .dashboard-header .profile,
  .dashboard-header .logout-btn {
    transition: color .2s var(--ui-motion), background-color .2s var(--ui-motion), border-color .2s var(--ui-motion), box-shadow .2s var(--ui-motion), transform .2s var(--ui-motion), opacity .2s var(--ui-motion) !important;
  }
}
