/* Hanken Grotesk, the PreBilt brand typeface, self-hosted so the strict
   default-src 'self' CSP needs no font host. Variable font (weights 100-900),
   latin + latin-ext subsets from @fontsource-variable/hanken-grotesk 5.3.0;
   SIL Open Font License, see fonts/HankenGrotesk-OFL.txt. */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/hanken-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design System Variables */
:root {
  /* PreBilt brand palette (PreBilt Brand Guidelines, October 2026), matching
     the PreBilt for Public Cloud admin (admin/src/app/globals.css) and the
     PreBilt ROI calculator (src/index.css). */
  --pb-navy: #0f1436;
  --pb-navy-rgb: 15, 20, 54;
  --pb-deep-purple: #25235a;
  --pb-lavender: #746eb5;
  --pb-lavender-rgb: 116, 110, 181;
  --pb-lavender-100: #ecebf9;
  --pb-lavender-200: #d4d1f0;
  --pb-lavender-300: #b7b3e0;
  --pb-lavender-400: #9a95d0;
  --pb-lavender-700: #4e498e;
  --pb-mint: #a0e2e0;
  --pb-mint-100: #effafa;
  --pb-mint-400: #b9eae8;
  --pb-mint-700: #31a09d;
  --pb-mint-800: #23716f;
  --pb-blush: #ffd4e6;
  --pb-white: #ffffff;
  --pb-neutral-100: #f9f9fd;
  --pb-neutral-200: #f8f7fd;
  --pb-neutral-300: #f4f3fc;
  /* Border and muted text from the PreBilt for Public Cloud admin theme */
  --pb-border: #e3e2ee;
  --pb-muted: #5d6079;

  /* Surfaces */
  --bg-1: var(--pb-white);
  --bg-2: var(--pb-neutral-200);
  --bg-3: var(--pb-neutral-300);
  --surface: var(--pb-white);
  --surface-elevated: var(--pb-white);
  --glass: var(--pb-white);
  --border: var(--pb-border);
  --border-light: var(--pb-neutral-300);
  --border-focus: var(--pb-navy);

  /* Primary: navy, as the admin's primary buttons */
  --brand: var(--pb-navy);
  --brand-rgb: var(--pb-navy-rgb);
  --brand-50: var(--pb-neutral-300);
  --brand-100: var(--pb-lavender-100);
  --brand-300: var(--pb-lavender-300);
  --brand-600: var(--pb-deep-purple);
  --brand-700: var(--pb-deep-purple);

  /* Secondary: lavender, the admin's focus ring and accent */
  --secondary: var(--pb-lavender);
  --secondary-50: var(--pb-lavender-100);
  --secondary-100: var(--pb-lavender-200);
  --secondary-300: var(--pb-lavender-400);
  --secondary-600: var(--pb-lavender);
  --secondary-700: var(--pb-lavender-700);

  /* Accent: mint (used for hint callouts) */
  --accent: var(--pb-mint);
  --accent-50: var(--pb-mint-100);
  --accent-100: var(--pb-mint-400);
  --accent-300: var(--pb-mint);
  --accent-600: var(--pb-mint-800); /* hint icon on --accent-50: 5.4:1 */
  --accent-700: var(--pb-mint-700);

  /* Text: navy, with muted tones that keep at least 4.5:1 on white and on
     --bg-2 (the old --text-muted #94a3b8 was 2.6:1) */
  --text: var(--pb-navy);
  --text-secondary: var(--pb-muted);
  --text-muted: #63667c;
  --text-light: var(--pb-lavender-100);
  --muted: var(--pb-muted);

  /* Focus: a 3px lavender ring outside a navy border, as the admin's inputs
     (the navy border keeps the 3:1 non-text contrast the ring alone lacks) */
  --focus-ring: 0 0 0 3px rgba(var(--pb-lavender-rgb), 0.5);

  /* Status Colors: semantic, the brand defines none */
  /* Keyboard focus outline (help icons and other controls) */
  --focus-ring-color: var(--pb-lavender);
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;
  --success: #10b981;
  --success-light: #d1fae5;
  --success-border: #34d399;
  --success-bg: #ecfdf5;
  --success-600: #059669;
  --warning: #fdc851;
  --warning-light: #fff9e6;
  --warning-border: #fdd866;
  --warning-bg: #fffbeb;
  --error: #ef4444;
  --error-light: #fee2e2;

  /* Typography: Hanken Grotesk in the brand's three weights (Regular,
     SemiBold, ExtraBold) */
  --font-family:
    "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-weight-normal: 400;
  --font-weight-medium: 600;
  --font-weight-semibold: 600;
  --font-weight-bold: 800;

  /* Professional Spacing - Compact */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii as the admin: 8px controls, 14px cards */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 0.875rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(var(--pb-navy-rgb), 0.08), 0 2px 4px -2px rgba(var(--pb-navy-rgb), 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(var(--pb-navy-rgb), 0.08), 0 4px 6px -4px rgba(var(--pb-navy-rgb), 0.08);
  --shadow-xl: var(--shadow-lg);

  /* Smooth Transitions - kept for backward compatibility with existing
     usages; new code should compose --duration-*/--ease-* instead so
     duration and easing can vary independently (e.g. a longer duration
     with the same easing, or vice versa). */
  --transition: 150ms ease-in-out;
  --transition-fast: 150ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --ease-standard: ease-in-out;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-Index Scale - every layered/floating element in this app should use
     one of these, not an ad hoc value, so stacking order stays predictable
     as more overlays are added. Values match what .topbar/.help-modal-overlay
     already used before this token existed - named, not renumbered, to
     avoid any stacking regression against third-party widgets (MSAL popup,
     FontAwesome kit) that may inject their own z-indexed elements. */
  --z-sticky: 100;
  --z-modal: 10000;
}

/* Inline icon sprite (public/index.html's <symbol> definitions, referenced
   via <svg class="icon"><use href="#icon-NAME"></use></svg>). Mirrors what
   each source Lucide SVG's own wrapper attributes provided, applied once
   here instead of repeated per-symbol. `color` on an ancestor flows through
   `stroke="currentColor"` exactly like the FontAwesome glyphs it replaces. */
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* Global Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-2);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Signed-in header: the dark master logo on white, like the PreBilt for
   Public Cloud admin's sidebar. Hidden on the sign-in page. */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}

.authenticated .topbar {
  display: block;
}

.topbar-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo {
  display: block;
  height: 28px;
  width: auto;
}

.brand-title {
  padding-left: var(--space-4);
  border-left: 1px solid var(--border);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 28px;
  color: var(--text-secondary);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-6) 0;
  height: auto;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  width: 100%;
}

/* Sign-in page, matching the PreBilt for Public Cloud admin sign-in
   (admin.prebilt.cloud/auth/login) and the PreBilt ROI calculator. The
   background is the Design Team's navy artwork with its logo painted out; the
   brand guidelines say not to draw brand shapes in CSS, so it stays an image.
   Set on body so it also covers overscroll and the footer. */
body:not(.authenticated) {
  background-color: var(--pb-navy);
  /* Anchored bottom-left, where the shapes bleed off the artwork */
  background-image: url("brand/background-navy.webp");
  background-size: cover;
  background-position: left bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body:not(.authenticated) .main-content {
  display: flex;
  align-items: center;
  padding: var(--space-6) 0;
}

.landing-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* One icon width of clear space between the logo and the card (guidelines p.9) */
  gap: 56px;
  padding: var(--space-6) 0;
}

.signin-logo {
  display: block;
  height: 40px;
  width: auto;
}

.signin-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 384px;
  padding: var(--space-6);
  background: var(--pb-white);
  color: var(--pb-navy);
  border: 1px solid var(--pb-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.signin-title {
  margin: 0;
  font-size: 24px;
  font-weight: var(--font-weight-semibold);
  line-height: 32px;
  letter-spacing: -0.6px;
  text-align: left;
}

.signin-description {
  margin: 6px 0 var(--space-6);
  font-size: var(--font-size-sm);
  line-height: 20px;
  color: var(--pb-muted);
  text-align: left;
  text-wrap: pretty; /* no one-word last line */
}

/* Outline button, as on the PreBilt for Public Cloud sign-in */
.main-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-4);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--pb-navy);
  background: var(--pb-white);
  border: 1px solid var(--pb-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none; /* also used as a link on signout.html */
  cursor: pointer;
  transition: background-color var(--transition);
}

.main-login-btn:hover {
  background: var(--pb-lavender-100);
}

.main-login-btn:focus-visible {
  outline: 2px solid var(--pb-lavender);
  outline-offset: 2px;
}

.main-login-btn svg {
  flex-shrink: 0;
}

/* No footer on the navy sign-in and sign-out pages, matching the PreBilt for
   Public Cloud admin sign-in. The copyright line and version stay in the
   signed-in app's footer. */
body:not(.authenticated) footer {
  display: none;
}

@media (min-width: 768px) {
  .landing-section {
    padding: var(--space-10) 0;
  }
}

/* Global toast notifications (public/error-handler.js) set position/right/
   max-width inline at creation time - its 400px max-width otherwise overflows
   past the left edge of any viewport narrower than ~440px (400px width + 20px
   right offset + margin), which also visually breaks "no horizontal page
   scrolling". The !important overrides here are deliberate: they exist
   specifically to override that inline style responsively, not to fight
   normal stylesheet specificity. */
@media (max-width: 480px) {
  #global-error-container {
    top: 12px !important;
    right: 12px !important;
    left: 12px !important;
    max-width: none !important;
  }

  #global-error-container .notification {
    width: auto;
  }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .main-login-btn {
    transition: none;
  }

  .rotating-gear {
    animation: none;
  }

  /* The progress-animation keyframe ends at stroke-dashoffset: 326.56 (full
     dasharray = invisible stroke), so just killing the animation duration
     would leave the ring looking blank/broken instead of static. Reset to
     the element's own resting dashoffset for a clear, unmoving indicator. */
  .progress-ring-circle {
    animation: none;
    stroke-dashoffset: 163.28;
  }
}

/* Card System */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-xl);
}

/* Form Container */
.form-container {
  padding: var(--space-8);
  margin-bottom: var(--space-6);
}

.form-container h2 {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-6);
  color: var(--text);
}

.step-p,
.step1-p,
.step2-p,
.step3-p,
.step4-p {
  text-align: center;
  color: var(--muted);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-base);
}

/* Section Headings */
.section-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--brand);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.header-icon .icon {
  font-size: var(--font-size-lg);
  color: white;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.section-heading {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text);
  margin: var(--space-8) 0 var(--space-6) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.section-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

/* Form Grid */
.form-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Configuration Page Layout */
.form-container.step.card {
  background: var(--bg-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-8);
  margin: var(--space-6) 0;
  border: 1px solid var(--border);
  position: relative;
  overflow: visible; /* Changed from hidden to visible for tooltips */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-container .section-header {
  text-align: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--bg-2);
  position: relative;
}

.form-container .section-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.6px;
  color: var(--text);
  margin: var(--space-4) 0;
}

.form-container .section-header p {
  color: var(--muted);
  font-size: var(--font-size-base);
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Enhanced Configuration Sections */
.config-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-6) 0;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.config-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.config-section-title .icon {
  color: var(--brand);
  font-size: var(--font-size-lg);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  border-radius: var(--radius);
  padding: var(--space-2);
}

/* Visual-only required indicator. The native `required` attribute already
   gives screen readers the accessible state, so the asterisk itself is
   aria-hidden to avoid a redundant "required, asterisk" announcement. */
.required-mark {
  color: var(--error);
  font-weight: var(--font-weight-semibold);
}

/* Advanced Options (native <details> - collapsed by default since these are
   genuinely secondary settings, unlike the always-open pre-build summary). */
.advanced-options-toggle {
  cursor: pointer;
  list-style: none;
}

.advanced-options-toggle::-webkit-details-marker {
  display: none;
}

.advanced-options-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

.advanced-options:not([open]) .advanced-options-toggle {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.enhanced-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .enhanced-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.enhanced-input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: all var(--transition);
}

.enhanced-input:hover {
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px rgba(var(--pb-lavender-rgb), 0.05);
}

.enhanced-input:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

/* Input Group Styles (for regular forms) */
.input-group {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: all var(--transition);
  margin-bottom: var(--space-4);
  position: relative;
  min-height: fit-content; /* Ensure consistent sizing */
}

.input-group:hover {
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px rgba(var(--pb-lavender-rgb), 0.05);
}

.input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.input-group label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.input-group input,
.input-group select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--text);
  font-size: var(--font-size-base);
  transition: all var(--transition);
  box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.input-group input::placeholder {
  color: var(--muted);
  font-style: italic;
}

.enhanced-input label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.enhanced-input input,
.enhanced-input select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--text);
  font-size: var(--font-size-base);
  transition: all var(--transition);
}

.enhanced-input input:focus,
.enhanced-input select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.enhanced-input input::placeholder {
  color: var(--muted);
}

.enhanced-prefix {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.enhanced-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-8) 0;
  border: none;
  position: relative;
}

.enhanced-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--brand);
  border-radius: 50%;
  border: 3px solid var(--bg-1);
}

/* Enhanced Select Wrapper */
.select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding-right: var(--space-12);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  font-size: var(--font-size-base);
  transition: all var(--transition);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-1);
  box-shadow: var(--focus-ring);
}

.select-wrapper select option {
  background: var(--bg-1);
  color: var(--text);
  padding: var(--space-2);
}

.select-arrow {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: var(--font-size-sm);
  transition: all var(--transition);
}

.select-wrapper:hover .select-arrow,
.select-wrapper:focus-within .select-arrow {
  color: var(--brand);
}

/* Input Groups */
.input-group {
  display: grid;
  gap: var(--space-3);
  position: relative;
}

.input-group label {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text);
  display: block;
}

.input-group input,
.input-group select {
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  font-size: var(--font-size-base);
  font-family: inherit;
  transition: all var(--transition-fast);
  width: 100%;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.input-group input::placeholder {
  color: var(--muted);
}

.input-group select {
  cursor: pointer;
}

.input-group select option {
  background: var(--bg-1);
  color: var(--text);
  padding: var(--space-2);
}

@media (min-width: 768px) {
  .input-group {
    grid-template-columns: 1fr;
    align-items: start;
    gap: var(--space-3);
  }

  .input-group.file-upload-group {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

.input-group label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

@media (min-width: 768px) {
  .input-group label {
    margin-bottom: 0;
    padding-top: var(--space-3);
  }
}

/* Input Styles */
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--font-size-base);
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

input::placeholder,
select::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Select Styling */
select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%2308A2DD%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M7.247%2011.14%202.451%205.658C1.885%205.013%202.345%204%203.204%204h9.592a1%201%200%200%201%20.753%201.659l-4.796%205.48a1%201%200%200%201-1.506%200z%22%2F%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  padding-right: var(--space-10);
  appearance: none;
}

/* Steps */
.step {
  display: none;
}

.step.active {
  display: block;
}

/* Initial State - Hide forms until authenticated */
#uploadForm,
#ewmForm,
.shared-steps {
  display: none;
}

/* Show forms when user is authenticated */
.authenticated #uploadForm,
.authenticated #ewmForm,
.authenticated .shared-steps {
  display: block;
}

.authenticated .landing-section {
  display: none;
}

/* Buttons */
.login-btn,
.continue-btn,
.download-btn {
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.continue-btn,
.download-btn {
  width: 100%;
  margin-top: var(--space-6);
}

.login-btn:hover,
.continue-btn:hover,
.download-btn:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.login-btn:active,
.continue-btn:active,
.download-btn:active {
  transform: translateY(0);
}

.continue-btn:disabled,
.download-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Enhanced Buttons */
.enhanced-button {
  position: relative;
  overflow: hidden;
  background: var(--brand);
  border: none;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: white;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  box-shadow: var(--shadow-sm);
}

.enhanced-button:hover {
  background: var(--brand-600);
  box-shadow: var(--shadow-md);
}

.enhanced-button:active {
  background: var(--brand-700);
}

.enhanced-button.primary {
  width: 100%;
  margin-top: var(--space-4);
  font-size: var(--font-size-base);
  padding: var(--space-4);
  min-height: 48px;
}

/* Override primary button width in action sections */
.action-section .enhanced-button.primary {
  width: auto;
  margin-top: 0;
}

.enhanced-button.primary .icon {
  font-size: var(--font-size-base);
}

.enhanced-button:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.enhanced-button.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border);
  box-shadow: none;
}

.enhanced-button.secondary:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.enhanced-button.secondary:active {
  background: var(--border-light);
}

/* Ensure secondary buttons in action sections have consistent styling */
.action-section .enhanced-button.secondary {
  border-color: var(--border);
  color: var(--text-secondary);
}

.action-section .enhanced-button.secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}

/* Flow Picker */
.flow-picker {
  display: grid;
  gap: var(--space-6);
  margin: var(--space-6) 0;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .flow-picker {
    grid-template-columns: 1fr 1fr;
    padding: 0;
  }
}

.flow-card {
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  position: relative;
}

.flow-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.flow-card.selected {
  border-color: var(--brand);
  background: var(--bg-2);
  box-shadow: var(--shadow-md);
}

.flow-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.flow-icon {
  font-size: 3rem;
  color: var(--brand);
  margin-bottom: var(--space-4);
  position: relative;
  display: inline-block;
}

.flow-card h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-3);
  position: relative;
}

.flow-card p {
  color: var(--muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
  line-height: 1.5;
  position: relative;
}

.flow-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
}

.feature {
  color: var(--muted);
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature::before {
  content: "✓";
  color: var(--brand);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

/* Upload Section */
.upload-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.upload-section label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  flex-shrink: 0;
  min-width: 120px;
}

/* Enhanced Upload Section */
.requirements-section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin: var(--space-6) 0;
  position: relative;
}

.requirements-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-4);
  position: relative;
}

.upload-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-4);
}

.file-input-container {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.upload-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  margin-bottom: var(--space-3);
}

.upload-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.enhanced-drop-zone {
  background: var(--bg-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin: var(--space-6) 0;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.enhanced-drop-zone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(var(--pb-lavender-rgb), 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1;
}

.enhanced-drop-zone:hover::before,
.enhanced-drop-zone.dragover::before {
  opacity: 1;
}

.enhanced-drop-zone:hover,
.enhanced-drop-zone.dragover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px rgba(var(--pb-lavender-rgb), 0.15),
    0 6px 12px rgba(0, 0, 0, 0.1);
}

.drop-zone-content {
  position: relative;
  z-index: 2;
}

.drop-icon {
  font-size: 3rem;
  color: var(--brand);
  margin-bottom: var(--space-4);
}

.drop-zone-content h4 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.drop-zone-content p {
  color: var(--muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-6);
}

.drop-zone-features {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.feature-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(var(--pb-lavender-rgb), 0.1);
  border: 1px solid rgba(var(--pb-lavender-rgb), 0.2);
  border-radius: var(--radius-full);
  color: var(--brand);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Accessible error summary - lists every currently-visible field error in
   one place. role="alert"/aria-live="assertive" announces it to screen
   readers as soon as it becomes visible; sighted users get a clear list
   of exactly what still needs fixing without hunting through the form. */
.validation-summary {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid var(--error);
  border-radius: var(--radius-lg);
}

.validation-summary-heading {
  margin: 0 0 var(--space-2);
  font-weight: var(--font-weight-semibold);
  color: var(--error);
}

.validation-summary-list {
  margin: 0;
  padding-left: var(--space-5);
  display: grid;
  gap: var(--space-1);
}

.validation-summary-list a {
  color: var(--text);
  text-decoration: underline;
}

.validation-summary-list a:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Pre-build summary (native <details> - collapsible with no JS needed,
   open by default on every width so it's visible without an extra click,
   but still collapsible if it's in the way). */
.build-summary {
  margin-top: var(--space-8);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.build-summary-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.build-summary-toggle::-webkit-details-marker {
  display: none;
}

.build-summary-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

.build-summary-list {
  margin: var(--space-4) 0 0;
  display: grid;
  gap: var(--space-2) var(--space-4);
}

.build-summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--font-size-sm);
}

.build-summary-row:last-child {
  border-bottom: none;
}

.build-summary-row dt {
  color: var(--text-muted);
  flex-shrink: 0;
}

.build-summary-row dd {
  margin: 0;
  color: var(--text);
  font-weight: var(--font-weight-medium);
  text-align: right;
  word-break: break-word;
}

@media (min-width: 768px) {
  .build-summary-list {
    grid-template-columns: 1fr 1fr;
  }
}

.action-section {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: stretch;
  margin-top: var(--space-8);
  flex-wrap: wrap;
  padding: 0 var(--space-2);
}

.action-section .back-btn {
  flex: 0 0 auto;
  min-width: 180px;
  height: auto;
  margin-top: 0;
}

.action-section .continue-btn {
  flex: 1;
  min-width: 200px;
  margin-top: 0;
  max-width: 300px;
}

/* Ensure both buttons have same height and alignment */
.action-section .back-btn,
.action-section .continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-4);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  gap: var(--space-2);
  border: 2px solid transparent;
}

/* Enhanced visual hierarchy for action buttons */
.action-section .back-btn {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.action-section .back-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand);
  background: var(--brand-50);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.action-section .continue-btn {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.action-section .continue-btn:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.action-section .continue-btn:disabled {
  background: var(--muted);
  border-color: var(--muted);
  color: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .action-section {
    flex-direction: column;
    gap: var(--space-3);
  }

  .action-section .back-btn,
  .action-section .continue-btn {
    width: 100%;
    flex: none;
  }
}

/* File Structure */
.file-structure {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  overflow-x: auto;
}

.file-structure ul {
  list-style: none;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.file-structure li {
  color: var(--muted);
  font-size: var(--font-size-sm);
  padding: var(--space-1) 0;
  white-space: nowrap;
}

/* File Input Wrapper */
.file-input-wrapper {
  display: flex;
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.file-input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.file-input-wrapper input[type="text"] {
  border: none;
  background: transparent;
  color: var(--muted);
  font-style: italic;
  flex: 1;
  height: 44px;
  padding: var(--space-3) var(--space-4);
}

.file-input-wrapper input[type="text"]:focus {
  box-shadow: none;
}

.select-file {
  background: var(--brand);
  color: white;
  border: none;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  white-space: nowrap;
}

.select-file:hover {
  background: var(--brand-600);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  background: var(--glass);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  margin: var(--space-4) 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--brand);
  background: rgba(var(--pb-lavender-rgb), 0.05);
  color: var(--brand);
}

.drop-zone p {
  margin: 0;
  font-size: var(--font-size-base);
}

/* Prefixed Input */
.prefixed-input-wrapper {
  display: flex;
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.prefixed-input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.input-prefix {
  background: var(--brand);
  color: white;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.prefixed-input-wrapper input {
  border: none;
  background: transparent;
  margin: 0;
  height: 44px;
  padding: var(--space-3) var(--space-4);
}

.prefixed-input-wrapper input:focus {
  box-shadow: none;
}

/* ========================================
   MODAL DIALOG HELP SYSTEM - REPLACES TOOLTIPS
   ======================================== */

/* Help icon styling */
/* Now a real <button> (was a bare, click-only, keyboard-unreachable <svg> -
   see the "help-icon" migration this session) so it needs a browser-chrome
   reset in addition to the original visual treatment. */
.help-icon {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  margin-left: var(--space-2);
  color: var(--secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition:
    color var(--duration-base) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.help-icon:hover {
  color: var(--secondary-700);
  transform: scale(1.1);
}

.help-icon:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Modal overlay */
.help-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.help-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Modal dialog */
.help-modal {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.help-modal-overlay.show .help-modal {
  transform: scale(1);
}

/* Modal header */
.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9ecef;
}

.help-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

/* Close button */
.help-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.help-modal-close:hover {
  background-color: #f8f9fa;
  color: #dc3545;
}

/* Modal content */
.help-modal-content {
  color: #495057;
  line-height: 1.6;
  font-size: 15px;
}

/* APK Builder theme colors */
.help-modal {
  border-top: 4px solid var(--pb-lavender);
}

.help-modal-title {
  color: var(--pb-lavender);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .help-modal {
    margin: 16px;
    padding: 20px;
    max-width: none;
    width: calc(100% - 32px);
  }

  .help-modal-title {
    font-size: 16px;
  }

  .help-modal-content {
    font-size: 14px;
  }
}

/* Error Messages */
.error-message {
  color: var(--error);
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
  display: none;
  padding: var(--space-2);
  background: var(--error-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--error);
  min-height: 0; /* Allow collapsing when hidden */
  transition: all 0.2s ease;
}

.error-message.visible {
  display: block;
  min-height: 32px; /* Reserve space for consistent layout */
}

/* Warning Messages */
.warning-message {
  color: var(--warning);
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
  display: block;
  padding: var(--space-2);
  background: var(--warning-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--warning-border);
}

/* Field Error and Warning States */
.input-error,
.field-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1) !important;
}

.field-warning {
  border-color: var(--warning) !important;
  box-shadow: 0 0 0 2px rgba(253, 200, 81, 0.1) !important;
}

/* Enhanced error visibility */
.input-group.has-error .error-message {
  display: block;
}

.input-group.has-warning .warning-message {
  display: block;
}

@media (min-width: 768px) {
  .error-message,
  .warning-message {
    grid-column: 2 / -1;
    margin-top: var(--space-1);
  }
}

.file-error-message,
.ewm-form-error {
  color: var(--error);
  font-size: var(--font-size-sm);
  margin: var(--space-2) 0;
  padding: var(--space-3);
  background: rgba(255, 56, 96, 0.1);
  border: 1px solid rgba(255, 56, 96, 0.2);
  border-radius: var(--radius);
  display: none;
}

.file-error-message.visible,
.ewm-form-error.visible {
  display: block;
}

.file-size-info {
  font-size: var(--font-size-sm);
  margin-top: var(--space-2);
  color: var(--muted);
  display: none;
}

.file-size-info.visible {
  display: block;
}

.file-size-info.warning {
  color: var(--warning);
}

.file-size-info.error {
  color: var(--error);
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-4);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--brand);
  }
}

.loading p {
  color: var(--muted);
  font-size: var(--font-size-base);
  margin: 0;
  max-width: 300px;
}

/* Professional Build Progress Styling */
.build-progress-container {
  padding: var(--space-6);
  text-align: center;
}

.build-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.build-animation {
  position: relative;
  display: inline-block;
  margin-bottom: var(--space-6);
}

.rotating-gear {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: var(--brand);
  font-size: 2rem;
  animation: rotate 2s linear infinite;
}

.build-progress-ring {
  position: relative;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle-bg {
  opacity: 0.3;
}

.progress-ring-circle {
  stroke-dasharray: 326.56;
  stroke-dashoffset: 163.28;
  animation: progress-animation 3s ease-in-out infinite;
  stroke-linecap: round;
}

@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes progress-animation {
  0% {
    stroke-dashoffset: 326.56;
  }
  50% {
    stroke-dashoffset: 81.64;
  }
  100% {
    stroke-dashoffset: 326.56;
  }
}

.build-info h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.build-status-text {
  font-size: var(--font-size-base);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.build-metrics {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.metric-label {
  font-size: var(--font-size-sm);
  color: var(--muted);
  font-weight: var(--font-weight-medium);
}

.metric-value {
  font-size: var(--font-size-base);
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

/* Honest stage-based build progress checklist (no fake percentage). Visual
   only - screen readers get the current stage from .build-status-text's
   aria-live region instead, so this list is aria-hidden in markup. */
.build-stage-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: left;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.build-stage-list li {
  position: relative;
  padding-left: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.build-stage-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65em;
  line-height: 1;
  color: #fff;
}

.build-stage-list li.active {
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

.build-stage-list li.active::before {
  border-color: var(--secondary);
  background: var(--secondary);
}

.build-stage-list li.done {
  color: var(--text-muted);
}

.build-stage-list li.done::before {
  /* A checkmark glyph, not just the fill colour, marks a stage done - so
     done vs. active is distinguishable without relying on colour alone. */
  content: "\2713";
  border-color: var(--success);
  background: var(--success);
}

.build-cancel-btn {
  margin-top: var(--space-4);
}

.build-cancel-btn[hidden] {
  display: none;
}

.build-tips {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(var(--pb-lavender-rgb), 0.05) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: left;
}

.build-tips h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.build-tips h4 .icon {
  color: var(--warning);
}

.tips-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .tips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tip-item .icon {
  color: var(--brand);
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.tip-item span {
  font-size: var(--font-size-sm);
  color: var(--text);
  line-height: 1.5;
}

/* Success Screen */
.success-container {
  padding: var(--space-6) 0;
}

.success-meta {
  margin-bottom: var(--space-8);
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.download-section {
  text-align: center;
}

.download-section .enhanced-button {
  margin: 0 var(--space-2) var(--space-2);
}

.install-info {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
}

.install-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.install-step .icon {
  color: var(--warning);
  flex-shrink: 0;
}

.enhanced-button.success {
  background: var(--success);
  box-shadow: var(--shadow-sm);
}

.enhanced-button.success:hover {
  background: var(--success-600);
  box-shadow: var(--shadow-md);
}

.header-icon.success {
  background: var(--success);
  box-shadow: var(--shadow-sm);
}

.header-icon.success::before {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(22, 163, 74, 0.3));
}

.header-icon.error {
  background: var(--error);
  box-shadow: var(--shadow-sm);
}

.header-icon.error::before {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(185, 28, 28, 0.3));
}

/* Build Failed step */
.build-failed-step .build-failed-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.build-failed-summary {
  color: var(--text);
}

.build-failed-action {
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.build-failed-action:empty {
  display: none;
}

.build-failed-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3) var(--space-6);
  margin: 0;
  padding: var(--space-4);
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.build-failed-meta-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.build-failed-meta dt {
  font-size: var(--font-size-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.build-failed-meta dd {
  margin: 0;
  font-family: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--font-size-sm);
  color: var(--text);
  word-break: break-word;
}

.build-failed-detail-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.build-failed-detail {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--error);
  border-radius: var(--radius);
  font-family: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

.build-failed-detail:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.build-failed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.build-failed-actions .enhanced-button {
  flex: 0 1 auto;
}

/* Accessibility utility — visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Profile Manager */
.profile-manager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-6) 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-manager-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.profile-manager-label .icon {
  color: var(--brand);
}

.profile-manager-select {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text);
  font-size: var(--font-size-sm);
}

.profile-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-manager-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.profile-manager-btn:hover:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.profile-manager-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-manager-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.profile-manager-btn.danger:hover:not(:disabled) {
  background: var(--error);
  border-color: var(--error);
}

.profile-manager-note {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--muted);
}

.profile-manager-note.warning {
  color: var(--warning);
}

@media (max-width: 600px) {
  .profile-manager-select {
    flex-basis: 100%;
  }
  .profile-manager-actions {
    width: 100%;
  }
  .profile-manager-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Form validation styles */
.input-error {
  border: 2px solid var(--error) !important;
}

/* Footer */
footer {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--muted);
  font-size: var(--font-size-sm);
  border-top: 1px solid var(--border);
  margin-top: var(--space-16);
}

/* Responsive Adjustments
   Ordered widest-to-narrowest below (1024 -> 767 -> 480) where breakpoints
   share a selector (.container in particular) - all three set .container's
   padding/max-width, and since none add real specificity over each other,
   source order decides the winner at any viewport matching more than one.
   Verified live: before this reordering, the 1024px block's wider padding
   was silently winning even at the 390px required test width. */
@media (max-width: 1024px) {
  .container {
    max-width: 720px;
    padding: 0 var(--space-5);
  }
}

@media (max-width: 767px) {
  .topbar-content {
    padding: 0 var(--space-4);
  }

  .container {
    max-width: 100%;
    padding: 0 var(--space-4);
  }

  .form-container {
    padding: var(--space-6);
  }

  .brand-title {
    font-size: var(--font-size-lg);
  }

  .logo {
    width: 40px;
  }

  .form-container h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
  }

  .flow-picker {
    gap: var(--space-4);
  }

  .flow-card {
    padding: var(--space-4);
  }

  .flow-card h3 {
    font-size: var(--font-size-lg);
  }

  .flow-icon {
    font-size: var(--space-8);
    margin-bottom: var(--space-3);
  }

  /* Removed mobile tooltip - replaced with modal system */

  .tooltip-text::after {
    display: none;
  }

  .input-group {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .input-group label {
    padding-top: 0;
  }

  /* Removed mobile tooltip container - replaced with modal system */

  .error-message {
    grid-column: 1;
    margin-top: var(--space-2);
  }
}

/* Deliberately placed AFTER the 767px block above: this 480px block sets
   smaller values for the SAME selectors (.topbar-content, .container,
   .form-container, .brand-title, .logo padding/font-size/width) for phones
   specifically. Both blocks match at any width <=480px, and since neither
   adds real selector specificity, source order decides the winner - this
   MUST stay after the 767px block, or the phone-specific downsizing below
   is silently overridden by the wider block's larger values (verified: it
   was, before this reordering, at the required 390px test width). */
@media (max-width: 480px) {
  .topbar-content {
    padding: 0 var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .logo {
    width: 32px;
  }

  .brand-title {
    font-size: var(--font-size-base);
  }

  .login-btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    min-height: 40px;
  }

  .container {
    padding: 0 var(--space-3);
  }

  .form-container {
    padding: var(--space-4);
  }

  .main-content {
    padding: var(--space-4) 0;
  }

  .upload-section {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .upload-section label {
    min-width: auto;
  }

  .file-structure {
    padding: var(--space-3);
  }

  .file-structure li {
    font-size: var(--font-size-xs);
  }

  .drop-zone {
    padding: var(--space-4);
    min-height: 60px;
  }

  .drop-zone p {
    font-size: var(--font-size-sm);
  }

  .file-input-wrapper {
    flex-direction: column;
  }

  .select-file {
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .file-input-wrapper input[type="text"] {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border);
  }

  .prefixed-input-wrapper {
    flex-direction: column;
  }

  .input-prefix {
    border-radius: var(--radius) var(--radius) 0 0;
    text-align: center;
  }

  .prefixed-input-wrapper input {
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* Focus Management */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .topbar,
  .footer {
    display: none;
  }

  .main-content {
    padding: 0;
  }

  .card {
    border: 1px solid #000;
    box-shadow: none;
    background: white;
    color: black;
  }
}

/* Enhanced Form Field Responsiveness and Professional Styling */
.enhanced-input .form-field,
.input-group .form-field {
  min-height: 44px;
  max-width: 100%;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
}

.enhanced-input .form-field:focus,
.input-group .form-field:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
  transform: none;
}

/* Select Elements Enhancement */
.enhanced-input select,
.input-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Button Consistency and Polish. Help icons are buttons too (for keyboard
   access) but keep their own small icon style (.help-icon), so they are left
   out here. */
.config-form .button,
.config-form .btn,
.config-form button:not(.help-icon),
.enhanced-input button:not(.help-icon),
.input-group button:not(.help-icon) {
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: var(--radius);
  background: var(--brand);
  color: white;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.config-form .button:hover,
.config-form .btn:hover,
.config-form button:not(.help-icon):hover,
.enhanced-input button:not(.help-icon):hover,
.input-group button:not(.help-icon):hover {
  background: var(--brand-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* File Input Professional Styling */
.enhanced-input input[type="file"],
.input-group input[type="file"] {
  padding: var(--space-3);
  border: 2px dashed var(--border);
  background: var(--bg-1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.enhanced-input input[type="file"]:hover,
.input-group input[type="file"]:hover {
  border-color: var(--brand);
  background: var(--brand-50);
}

/* Loading States */
.config-form .loading,
.enhanced-input .loading,
.input-group .loading {
  position: relative;
  pointer-events: none;
  color: transparent;
}

.config-form .loading::after,
.enhanced-input .loading::after,
.input-group .loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Final Polish - Ensure Form Fields Stay Within Boundaries */
.config-section .enhanced-input,
.config-section .input-group {
  max-width: 100%;
  overflow: hidden;
}

.config-section .form-field {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Configuration Screen Success State */
.config-success {
  background: var(--success-light);
  border: 1px solid var(--success);
  color: var(--success-dark);
  padding: var(--space-4);
  border-radius: var(--radius);
  margin: var(--space-4) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.config-success::before {
  content: "✓";
  font-weight: bold;
  font-size: 1.2em;
}

/* EWM Drop Zone Drag State */
.drop-zone.drag-over,
#ewmDropZone.drag-over {
  border-color: var(--brand);
  background: var(--brand-50);
  transform: scale(1.02);
}

#ewmDropZone {
  cursor: pointer;
  transition: all var(--transition);
}

/* Vertical Layout Styles */
.vertical-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  max-width: 100%;
  padding: 0 var(--space-4);
  box-sizing: border-box;
}

.requirements-section.compact {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: var(--space-5);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.upload-section.compact {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: var(--space-5);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

/* Compact Layout Styles (Legacy - kept for compatibility) */
.compact-layout {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.compact-layout .requirements-section.compact {
  flex: 1;
  margin-bottom: 0;
}

.compact-layout .upload-section.compact {
  flex: 1;
  margin-bottom: 0;
}

.file-structure.compact {
  background: var(--bg-1);
  border-radius: var(--radius);
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.structure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.structure-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0; /* Prevent overflow */
  overflow-wrap: break-word;
}

.structure-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  border: 1px solid var(--border-light);
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  transition: all var(--transition-fast);
}

.structure-item:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--text);
}

.structure-item .icon {
  color: var(--brand);
  font-size: var(--font-size-xs);
  width: 14px;
  text-align: center;
}

.structure-item span {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

/* Dynamic Drop Container */
.file-input-container.dynamic-drop {
  position: relative;
  transition: all var(--transition);
  border-radius: var(--radius);
  background: var(--bg-1);
  border: 2px solid var(--border);
  cursor: pointer;
}

.file-input-container.dynamic-drop:hover {
  border-color: var(--brand-200);
  background: var(--brand-25);
}

.file-input-container.dynamic-drop.drag-active {
  border-color: var(--brand);
  background: var(--brand-50);
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(var(--pb-lavender-rgb), 0.25);
}

.file-input-container.dynamic-drop.drag-active::after {
  content: "Drop your .zip file here";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--brand);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  border: 2px solid white;
}

/* Updated File Input Wrapper */
.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  transition: all var(--transition);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.file-input-wrapper:hover {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.file-input-wrapper input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  font-size: var(--font-size-base);
  color: var(--text);
}

.file-input-wrapper input[type="text"]:focus {
  outline: none;
}

.file-input-wrapper .select-file {
  flex-shrink: 0;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

/* Removed file-input-wrapper tooltip - replaced with modal system */

/* Compact Requirements and Upload Titles */
.requirements-title,
.upload-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 600;
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-light);
}

.upload-hint {
  font-size: var(--font-size-sm);
  color: var(--muted);
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  background: var(--brand-25);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.upload-hint .icon {
  color: var(--brand);
  font-size: var(--font-size-base);
}

.upload-format-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

.requirements-title .icon,
.upload-title .icon {
  color: var(--brand);
  font-size: var(--font-size-base);
}

/* Enhanced Section Separation */
.requirements-section.compact {
  background: var(--bg-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.upload-section.compact {
  background: var(--bg-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

/* Responsive Design for Layouts */
@media (max-width: 968px) {
  .compact-layout {
    flex-direction: column;
    gap: var(--space-4);
  }

  .vertical-layout {
    gap: var(--space-4);
  }

  .structure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .file-input-wrapper {
    flex-direction: column;
    gap: var(--space-2);
    align-items: stretch;
  }

  /* Removed mobile tooltip container - replaced with modal system */

  .vertical-layout {
    gap: var(--space-3);
    padding: 0 var(--space-2);
  }

  .requirements-section.compact,
  .upload-section.compact {
    padding: var(--space-4);
  }

  .form-container.step.card {
    padding: var(--space-4);
    margin: var(--space-3) 0;
  }
}

/* SSL Certificate Configuration Styles */
.ssl-option-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: all 0.3s ease;
}

.ssl-option-card:hover {
  border-color: var(--border-focus);
  box-shadow: 0 2px 8px rgba(var(--pb-navy-rgb), 0.05);
}

.checkbox-group.enhanced-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.ssl-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.checkbox-label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1.4;
}

.checkbox-label .icon:first-child {
  color: var(--brand);
  font-size: 1.1em;
}

.ssl-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  padding-left: var(--space-6);
  line-height: 1.5;
}

.ssl-description .icon {
  color: var(--secondary);
  margin-right: var(--space-1);
}

.ssl-description strong {
  color: var(--brand);
}

.ssl-upload-section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.ssl-upload-section.hidden {
  display: none !important;
}

.ssl-file-input {
  background: var(--bg-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: all 0.3s ease;
}

.ssl-file-input:hover {
  border-color: var(--border-focus);
  background: var(--secondary-50);
}

.ssl-naming-hint {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--accent-50);
  border: 1px solid var(--accent-300);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.ssl-naming-hint .icon-lightbulb {
  color: var(--accent-600);
  margin-right: var(--space-1);
}

.ssl-naming-hint code {
  background: rgba(var(--pb-navy-rgb), 0.1);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

.ssl-naming-hint strong {
  color: var(--brand);
}

.ssl-naming-hint small {
  color: var(--text-muted);
  font-style: italic;
}

/* SSL Certificate Validation States */
.ssl-option-card.active {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.ssl-option-card.error {
  border-color: var(--error);
  background: var(--error-light);
}

/* Responsive SSL Configuration */
@media (max-width: 768px) {
  .ssl-option-card {
    padding: var(--space-3);
  }

  .checkbox-group.enhanced-checkbox {
    flex-direction: column;
    gap: var(--space-1);
  }

  .ssl-description {
    padding-left: 0;
    margin-top: var(--space-2);
  }

  .ssl-upload-section {
    padding: var(--space-3);
  }

  .ssl-naming-hint {
    padding: var(--space-2);
  }
}
