/* Quote Disclaimer Styling */
.quote-disclaimer {
  margin-top: 3rem;
  padding: 1.5rem 1.5rem 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--muted);
  font-size: 0.98rem;
  box-shadow: 0 2px 8px rgba(11,22,34,0.04);
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.disclaimer-title {
  font-weight: 700;
  color: var(--fg);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}
.disclaimer-body {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}
@media print {
  /* Disable all theme-based wordmark switching for print */
  :root[data-theme="dark"] .wordmark-light,
  :root[data-theme="dark"] .brandmark .wordmark-light,
  :root[data-theme="light"] .wordmark-dark,
  :root[data-theme="light"] .brandmark .wordmark-dark {
    display: initial !important;
  }
  /* Only show light wordmark, hide dark for print */
  .wordmark-dark,
  .brand .wordmark-dark,
  .brandmark .wordmark-dark {
    display: none !important;
  }
  .wordmark-light,
  .brand .wordmark-light,
  .brandmark .wordmark-light {
    display: inline-block !important;
  }
}
@media print {
  /* Always show light wordmark, hide dark for print regardless of theme */
  .wordmark-dark,
  .brand .wordmark-dark,
  .brandmark .wordmark-dark {
    display: none !important;
  }
  .wordmark-light,
  .brand .wordmark-light,
  .brandmark .wordmark-light {
    display: inline-block !important;
  }
}
/* CSS Custom Properties for Theme Support */
:root {
  --bg: #ffffff;
  --fg: #0b1622;
  --muted: #6b7280;
  --brand: #20c9d2;
  --accent: #f26430;
  --card: #f9fafb;
  --line: #e5e7eb;
  --focus: #3b82f6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

:root[data-theme="dark"] {
  --bg: #0b1622;
  --fg: #e5e7eb;
  --muted: #94a3b8;
  --brand: #20c9d2;
  --accent: #f26430;
  --card: #111827;
  --line: #1f2937;
  --focus: #60a5fa;
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
}
/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Add a bit more horizontal padding for mobile and tablet */
@media (max-width: 1024px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Header */
.site-header {
  background-color: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}


.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--brand);
}

.brand .wordmark {
  display: none;
  height: 32px;
  width: auto;
  vertical-align: middle;
  user-select: none;
}

:root[data-theme="light"] .brand .wordmark-light,
:root:not([data-theme]),
:root:not([data-theme]) .brand .wordmark-light {
  display: inline-block;
}

:root[data-theme="dark"] .brand .wordmark-dark {
  display: inline-block;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--muted);
}

:root[data-theme="light"] .moon-icon,
:root[data-theme="dark"] .sun-icon,
:root:not([data-theme]) .moon-icon {
  display: none;
}

:root[data-theme="light"] .sun-icon,
:root[data-theme="dark"] .moon-icon,
:root:not([data-theme]) .sun-icon {
  display: block;
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 80px);
  padding: 0 1em;
}

/* Password Overlay */
.password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.password-dialog {
  background-color: var(--card);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 400px;
  width: 100%;
  border: 1px solid var(--line);
}

.password-content {
  padding: 2rem;
}

.password-content h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: var(--fg);
}

.password-content p {
  margin: 0 0 1.5rem 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

/* Password Form */
.password-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.password-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background-color: var(--bg);
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.password-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 201, 210, 0.1);
}

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

.submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--brand);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
  background-color: #1cb8c4;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.error-message {
  padding: 0.75rem;
  background-color: var(--error);
  color: white;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.security-notice {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Quote Content */
.quote-content {
  padding: 2rem 0;
}

.quote-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--line);
}

.quote-meta h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
}

.quote-meta .client-name {
  margin: 0.25rem 0;
  font-size: 1.25rem;
  color: var(--brand);
  font-weight: 500;
}

.quote-meta p {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quote-meta .quote-number {
  color: var(--muted);
}

.quote-meta .label {
  color: var(--fg);
  font-weight: 600;
  margin-right: 0.35rem;
}

.quote-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.quote-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.quote-side-meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.9rem;
}

.quote-side-meta .side-line {
  margin: 0.125rem 0;
}

.quote-side .label {
  color: var(--fg);
  font-weight: 600;
  margin-right: 0.35rem;
}

.logout-btn,
.print-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.logout-btn:hover,
.print-btn:hover {
  color: var(--fg);
  border-color: var(--muted);
}

.logout-btn:hover {
  color: var(--error);
  border-color: var(--error);
}

/* Quote Body Content */
.quote-body {
  line-height: 1.7;
}

.quote-body h2 {
  color: var(--fg);
  margin: 2rem 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.quote-body h3 {
  color: var(--fg);
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.quote-body p {
  margin: 1rem 0;
  color: var(--fg);
}

.quote-body ul,
.quote-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.quote-body li {
  margin: 0.5rem 0;
  color: var(--fg);
}

.quote-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background-color: var(--card);
  border-left: 4px solid var(--brand);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

.quote-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background-color: var(--card);
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.quote-body th,
.quote-body td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.quote-body th {
  background-color: var(--bg);
  font-weight: 600;
  color: var(--fg);
}

.quote-body tr:last-child td {
  border-bottom: none;
}

.quote-body .total-row {
  font-weight: 600;
  background-color: var(--bg);
}

.quote-body .total-row td {
  border-top: 2px solid var(--brand);
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .quote-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .quote-side {
    align-items: flex-start;
  }
  .quote-side-meta {
    text-align: left;
  }
  
  .quote-actions {
    justify-content: flex-end;
  }
  
  .quote-meta h1 {
    font-size: 1.5rem;
  }
  
  .password-content {
    padding: 1.5rem;
  }
  
  .container {
    padding: 0 0.75rem;
  }
}

/* Print Styles */

@media print {
  .site-header,
  .password-overlay,
  .quote-actions {
    display: none !important;
  }
  .quote-content {
    padding: 0 !important;
  }
  .quote-header {
    border-bottom: 2px solid #000;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }
  body {
    background: #fff !important;
    color: #0b1622 !important;
  }
  :root {
    --bg: #ffffff !important;
    --fg: #0b1622 !important;
    --muted: #6b7280 !important;
    --brand: #20c9d2 !important;
    --accent: #f26430 !important;
    --card: #f9fafb !important;
    --line: #e5e7eb !important;
    --focus: #3b82f6 !important;
    --success: #10b981 !important;
    --error: #ef4444 !important;
    --warning: #f59e0b !important;
  }
  /* Always show light wordmark, hide dark for print */
  .wordmark-dark,
  .brandmark .wordmark-dark {
    display: none !important;
  }
  .wordmark-light,
  .brandmark .wordmark-light {
    display: inline-block !important;
  }
  .quote-body table {
    border: 1px solid #000;
  }
  .quote-body th,
  .quote-body td {
    border-bottom: 1px solid #000;
  }
}

.quote-letterhead {
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.letterhead-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
}
.brandmark { /* keep it big but tasteful */
  color: var(--brand);
  line-height: 1;
}
.brandmark svg { /* clamp size, scale responsively */
  height: clamp(40px, 6vw, 72px);
  width: auto;
  display: block;
}
.letterhead-meta {
  text-align: right;
  font-style: normal; /* override address italics */
  color: var(--muted);
  font-size: 0.95rem;
}
.letterhead-meta .strong {
  color: var(--fg);
  font-weight: 600;
}
.letterhead-meta a { color: var(--fg); text-decoration: none; }
.letterhead-meta a:hover { text-decoration: underline; }


/* Compact on small screens */
@media (max-width: 640px) {
  .letterhead-inner { grid-template-columns: 1fr; gap: 0.5rem; }
  .letterhead-meta { text-align: left; font-size: 0.9rem; }
}



/* Wordmark switching for both header and letterhead */
:root[data-theme="light"] .wordmark-dark,
:root[data-theme="light"] .brandmark .wordmark-dark {
  display: none !important;
}
:root[data-theme="light"] .wordmark-light,
:root[data-theme="light"] .brandmark .wordmark-light {
  display: inline-block !important;
}
:root[data-theme="dark"] .wordmark-light,
:root[data-theme="dark"] .brandmark .wordmark-light {
  display: none !important;
}
:root[data-theme="dark"] .wordmark-dark,
:root[data-theme="dark"] .brandmark .wordmark-dark {
  display: inline-block !important;
}

/* Print-friendly letterhead */
@media print {
  .quote-letterhead { border-bottom: 2px solid #000; }
  .brandmark { color: #000 !important; }
  .letterhead-meta { color: #000 !important; }
  .letterhead-meta a { color: #000 !important; text-decoration: none; }
}

/* Quote Entry Page */
.quote-entry {
  max-width: 500px;
  margin: 4rem auto;
  text-align: center;
  padding: 2rem;
}

.logo-section {
  margin-bottom: 3rem;
}

.logo-section .brandmark {
  margin-bottom: 1rem;
}

.logo-section .brandmark svg,
.logo-section .brandmark img {
  height: clamp(60px, 10vw, 120px);
  width: auto;
  display: block;
  margin: 0 auto;
}

.quotes-label {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--fg);
  margin: 0;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.password-form {
  margin-bottom: 2rem;
}

.password-form .form-group {
  margin-bottom: 1.5rem;
}

.password-form .password-input {
  width: 100%;
  max-width: 400px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border: 2px solid var(--line);
  border-radius: 0.75rem;
  background-color: var(--card);
  color: var(--fg);
  text-align: center;
  transition: all 0.2s ease;
}

.password-form .password-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 201, 210, 0.1);
}

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

.password-form .submit-btn {
  width: 100%;
  max-width: 400px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background-color: var(--brand);
  color: white;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto;
}

.password-form .submit-btn:hover:not(:disabled) {
  background-color: #1cb8c4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(32, 201, 210, 0.3);
}

.password-form .submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  .quote-entry {
    margin: 2rem auto;
    padding: 1.5rem;
  }
  
  .quotes-label {
    font-size: 2rem;
  }
  
  .password-form .password-input,
  .password-form .submit-btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
}