/* Unified stylesheet for all CAP Brand Tools pages. */

/* Home page styles */

:root {
  --bg: #f4f7fb;
  --bg-top: #f8fbff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #12263a;
  --text-soft: #526377;
  --text-faint: #5f6e83;

  --brand: #0f4c81;
  --brand-dark: #0b3559;
  --brand-light: #e8f1f8;

  --border: #d9e2ec;
  --border-strong: #bcccdc;

  --warning-bg: #fff7e6;
  --warning-border: #f2d49b;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --pill: 999px;

  --max-width: 1360px;
  --transition: 0.18s ease;
}

/* Header */

/* Tool switcher */

.tool-switcher button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  text-decoration: none;
}

.tool-switcher button:disabled,
.tool-switcher button.disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  opacity: 0.7;
}

.tool-switcher button:disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
}

/* Layout */

/* Cards */

.section-heading h2,
.preview-card h2,
.tool-card h3,
.landing-info__section h3 {
  margin: 0;
  line-height: 1.2;
}

.section-heading p,
.preview-card__title p,
.page-footer,
.tool-card p,
.landing-info__section p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

/* Callout */

/* Tool grid */

.tool-grid {
  display: grid;
  gap: 1rem;
}

.tool-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.tool-card__content {
  display: grid;
  gap: 0.5rem;
}

.tool-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.button--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 10px 20px rgba(15, 76, 129, 0.18);
}

.button--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* Preview */

.preview-surface {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fb 100%);
}

.landing-info {
  display: grid;
  gap: 1rem;
}

.landing-info__section {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

/* Footer */

/* Responsive */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, var(--max-width));
    padding-top: 1rem;
  }

  .page-header__inner,
  .guidance-card,
  .preview-card {
    padding: 1rem;
  }

  .form-section {
    padding: 1rem;
  }

  .tool-switcher {
    flex-direction: column;
  }

  .tool-switcher button {
    width: 100%;
  }

  .page-header h1 {
    font-size: 1.9rem;
  }
}

/* Business Card Generator styles */

:root {
  --bg: #f4f7fb;
  --bg-top: #f8fbff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #12263a;
  --text-soft: #526377;
  --text-faint: #5f6e83;
  --brand: #0f4c81;
  --brand-dark: #0b3559;
  --brand-light: #e8f1f8;
  --border: #d9e2ec;
  --border-strong: #bcccdc;
  --warning-bg: #fff7e6;
  --warning-border: #f2d49b;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --pill: 999px;
  --max-width: 1360px;
  --transition: 0.18s ease;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.tool-switcher__link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--pill);
  padding: 0.82rem 1rem;
  font-weight: 700;
  transition:
    background var(--transition),
    transform var(--transition),
    border-color var(--transition);
  text-decoration: none;
}

.tool-switcher__link:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  text-decoration: none;
}

.tool-switcher__link--current {
  background: #fff;
  color: var(--brand-dark);
  border-color: #fff;
  cursor: default;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
  align-items: start;
}

.preview-sticky {
  position: sticky;
  top: 1rem;
}

.form-section {
  padding: 1.25rem;
}

.form-section + .form-section {
  border-top: 1px solid var(--border);
}

.callout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.callout__header h3 {
  margin: 0;
}

.callout-toggle {
  border: 1px solid var(--border-strong);
  border-radius: var(--pill);
  padding: 0;
  width: 2rem;
  height: 2rem;
  background: #fff;
  color: var(--brand-dark);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.callout-toggle:hover {
  background: var(--brand-light);
}

.callout p {
  margin: 0.4rem 0 0;
  line-height: 1.65;
}

.guidance-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.7;
}

.guidance-list li + li {
  margin-top: 0.3rem;
}

.validation-box {
  margin: 1.25rem;
  padding: 1rem;
  border: 1px solid #f5c2c7;
  border-left: 4px solid rgb(186, 12, 47);
  border-radius: 10px;
  background: #fff5f5;
}

.validation-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--brand);
}

.validation-box ul {
  margin: 0 0 0 1.1rem;
  padding: 0;
  list-style: disc;
}

.validation-box li {
  margin: 0.35rem 0;
  line-height: 1.5;
  color: var(--text);
}

.button--primary,
.form-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 10px 20px rgba(15, 76, 129, 0.18);
}

.button--primary:hover,
.form-actions button:hover {
  transform: translateY(-1px);
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  text-decoration: none;
}

.button--disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.button--disabled:hover,
button:disabled:hover {
  transform: none;
  background: var(--brand);
  border-color: var(--brand);
}

.generator-form label,
.form-section label {
  display: block;
  margin: 0 0 0.65rem;
  font-weight: 700;
  color: var(--text);
}

.generator-form label span,
.form-section label span {
  color: var(--danger);
}

.generator-form input,
.generator-form select,
.generator-form textarea,
.form-section input,
.form-section select,
.form-section textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.02);
}

.generator-form input::placeholder,
.generator-form textarea::placeholder,
.form-section input::placeholder,
.form-section textarea::placeholder {
  color: var(--text-faint);
}

.generator-form input:focus,
.generator-form select:focus,
.generator-form textarea:focus,
.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
  outline: none;
  border-color: rgba(15, 76, 129, 0.55);
  box-shadow:
    0 0 0 4px rgba(15, 76, 129, 0.12),
    inset 0 1px 2px rgba(16, 24, 40, 0.02);
}

input.error,
select.error,
textarea.error {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

select option:disabled {
  color: #9aa5b1;
}

#grade optgroup {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

#grade option {
  font-weight: 500;
  color: var(--text);
}

#grade option:disabled {
  color: #9aa5b1;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.dual {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.grade-name-row {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) minmax(220px, 1.2fr);
  gap: 0.75rem;
}

.checkbox-row {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-row label {
  margin: 0;
  font-weight: 600;
}

.preview-frame {
  position: relative;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fb 100%);
}

.preview-frame iframe,
#pdf {
  width: 100%;
  height: 72vh;
  min-height: 720px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  display: block;
}

.preview-overlay {
  position: absolute;
  inset: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
}

.preview-overlay__content {
  max-width: 320px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.5;
}

.preview-disabled {
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}

.page-footer a {
  color: inherit;
  text-decoration: underline;
}

.muted {
  color: var(--text-soft);
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }

  .preview-frame iframe,
  #pdf {
    height: 70vh;
    min-height: 560px;
  }
}

@media (max-width: 840px) {
  .grade-name-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, var(--max-width));
    padding-top: 1rem;
  }

  .page-header__inner,
  .guidance-card,
  .preview-card {
    padding: 1rem;
  }

  .form-section {
    padding: 1rem;
  }

  .validation-box {
    margin: 1rem;
  }

  .tool-switcher {
    flex-direction: column;
  }

  .tool-switcher__link {
    width: 100%;
  }

  .page-header h1 {
    font-size: 1.9rem;
  }

  .preview-frame iframe,
  #pdf {
    height: 62vh;
    min-height: 420px;
  }
}

.validation-box {
  margin: 1rem 1.25rem 0;
  padding: 14px 16px;
  border: 1px solid #f2b8bf;
  border-left: 4px solid rgb(186, 12, 47);
  border-radius: 10px;
  background: #fff5f5;
}

.validation-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #001489;
}

.validation-box ul {
  margin: 0 0 0 18px;
  padding: 0;
  list-style: disc;
}

.validation-box li {
  margin: 6px 0;
  line-height: 1.45;
}

/* Signature Generator styles */

:root {
  --bg: #f4f7fb;
  --bg-top: #f8fbff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #12263a;
  --text-soft: #526377;
  --text-faint: #5f6e83;

  --brand: #0f4c81;
  --brand-dark: #0b3559;
  --brand-light: #e8f1f8;

  --border: #d9e2ec;
  --border-strong: #bcccdc;

  --warning-bg: #fff7e6;
  --warning-border: #f2d49b;

  --danger-bg: #fff5f5;
  --danger-border: #f5c2c7;
  --danger-accent: rgb(186, 12, 47);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --pill: 999px;

  --max-width: 1360px;
  --transition: 0.18s ease;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

/* Hidden from sighted users 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;
}

/* Visible keyboard focus indicator for interactive elements. */
a:focus-visible,
button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Light ring for controls sitting on the dark page header. */
.tool-switcher__link:focus-visible,
.tool-switcher button:focus-visible,
.header-changelog-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Header */

/* Tool switcher */

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.92fr);
  gap: 1.5rem;
  align-items: start;
}

.preview-column {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.controls-column {
  display: grid;
  gap: 1rem;
}

/* Cards */

.guidance-card,
.preview-card,
.copy-steps {
  padding: 1.25rem;
}

.guidance-card h2,
.preview-card h2,
.copy-steps h3,
.section-heading h2 {
  margin: 0;
  line-height: 1.2;
}

.section-heading p,
.guidance-card > p,
.copy-steps p,
.page-footer,
.preview-card__title p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.callout ul,
.copy-steps ol {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.7;
}

/* Form */

.form-card {
  overflow: hidden;
  padding: 0;
}

.form-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.field {
  display: grid;
  gap: 0.55rem;
}

.req {
  color: var(--danger-accent);
}

.note {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-faint);
}

.field-help {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.checkbox-field {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-soft);
}

.checkbox-field input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0;
  accent-color: var(--brand);
}

.dual {
  display: grid;
  gap: 0.9rem;
}

.dual--triple {
  grid-template-columns: 180px minmax(180px, 220px) minmax(0, 1fr);
}

.dual--pair {
  grid-template-columns: 180px minmax(0, 1fr);
}

#f_phone .dual {
  margin-bottom: 0.85rem;
}

#f_phone .dual:last-of-type {
  margin-bottom: 0;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

/* Validation */

#validation_warnings {
  margin-bottom: 1rem !important;
}

.subtle-warning {
  display: none;
  margin-top: 0.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-accent);
  font-size: 0.92rem;
  line-height: 1.5;
}

.subtle-warning.show {
  display: block;
}

/* Preview */

.preview-card {
  overflow: hidden;
}

.preview-surface {
  min-height: 250px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fb 100%);
  overflow: auto;
}

#preview_rendered {
  min-height: 200px;
}

/* Footer / helper card */

.copy-steps h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

/* Responsive */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-column,
  .preview-sticky {
    position: static;
  }
}

@media (max-width: 860px) {
  .dual--triple,
  .dual--pair {
    grid-template-columns: 1fr;
  }

  .preview-card__header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, var(--max-width));
    padding-top: 1rem;
  }

  .page-header__inner,
  .guidance-card,
  .preview-card,
  .copy-steps {
    padding: 1rem;
  }

  .form-section {
    padding: 1rem;
  }

  .tool-switcher {
    flex-direction: column;
  }

  .tool-switcher button {
    width: 100%;
  }

  .page-header h1 {
    font-size: 1.9rem;
  }

  .preview-surface {
    min-height: 360px;
  }
}
.field-help {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted, #5b6875);
  line-height: 1.45;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.action-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #0f4c81;
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn:disabled,
.action-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.action-btn.is-disabled:hover {
  transform: none;
}

.action-btn--secondary {
  background: #334155;
}

.copy-status {
  display: none;
  margin-top: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.copy-status.show {
  display: block;
}

.copy-status--success {
  background: #edfdf3;
  border: 1px solid #b7ebc6;
  color: #166534;
}

.copy-status--error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-accent);
}

.callout--collapsible {
  padding: 0;
  overflow: hidden;
}

.callout-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.75rem;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.callout-toggle:hover {
  background: rgba(0, 0, 0, 0.02);
}

.callout-toggle:focus-visible {
  outline: 2px solid #001489;
  outline-offset: -2px;
}

.callout-toggle__icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.callout-content {
  padding: 0 1rem 1rem;
}

.callout-content.is-collapsed {
  display: none;
}

/* Logo Generator styles */

:root {
  --bg: #f4f7fb;
  --bg-top: #f8fbff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #12263a;
  --text-soft: #526377;
  --text-faint: #5f6e83;

  --brand: #0f4c81;
  --brand-dark: #0b3559;
  --brand-light: #e8f1f8;

  --border: #d9e2ec;
  --border-strong: #bcccdc;

  --warning-bg: #fff7e6;
  --warning-border: #f2d49b;

  --danger-bg: #fff5f5;
  --danger-border: #f5c2c7;
  --danger-accent: rgb(186, 12, 47);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --pill: 999px;

  --max-width: 1500px;
  --transition: 0.18s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(15, 76, 129, 0.08), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

img,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

/* Header */

.page-header {
  margin-bottom: 1.5rem;
}

.page-header__inner {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 76, 129, 0.98), rgba(11, 53, 89, 0.98));
  color: #fff;
  box-shadow: var(--shadow-md);
}

.page-header__content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.page-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.65;
}

/* Tool switcher */

.tool-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tool-switcher button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--pill);
  padding: 0.82rem 1rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.tool-switcher button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.tool-switcher button.active {
  background: #fff;
  color: var(--brand-dark);
  border-color: #fff;
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 1fr);
  gap: 2rem;
  align-items: start;
}

.controls-column,
.preview-column {
  min-width: 0;
}

.controls-column {
  display: grid;
  gap: 1rem;
  min-height: 0;
}

.preview-column {
  position: sticky;
  top: 0.75rem;
  z-index: 1;
  align-self: start;
}

.preview-sticky {
  display: grid;
  gap: 1rem;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.guidance-card,
.preview-card {
  padding: 1.25rem;
}

.section-heading {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.preview-card h2 {
  margin: 0;
  line-height: 1.2;
}

.section-heading p,
.preview-card__title p,
.page-footer {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

/* Guidance callout */

.callout {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.callout--warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.callout h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.callout ul {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.7;
}

/* Form */

.form-card {
  overflow: visible;
  padding: 0;
  position: relative;
  z-index: 1;
}

.form-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  overflow: visible;
  position: relative;
}

.form-section:last-child {
  border-bottom: 0;
}

.field {
  display: grid;
  gap: 0.55rem;
  overflow: visible;
  position: relative;
}

label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  font-weight: 700;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

input[type="file"] {
  padding: 0.65rem 0.75rem;
}

input::placeholder,
textarea::placeholder {
  color: #7b8794;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 76, 129, 0.65);
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.12);
}

input:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field-help,
#charCounter {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.subtle-warning {
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Upload row */

.upload-stack {
  display: grid;
  gap: 0.85rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0.2rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  accent-color: var(--brand);
  cursor: pointer;
  box-shadow: none;
}

/* Preview */

.preview-card {
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.preview-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.preview-card__title {
  display: grid;
  gap: 0.35rem;
}

.preview-surface {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fb 100%);
}

.canvas-frame {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  position: relative;
  z-index: 1;
}

#canvas {
  width: 100%;
  height: auto;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  background-color: #ffffff;
}

#canvas.white-preview {
  background-color: #d9d9d9;
}

/* Buttons */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preview-actions {
  margin-top: 1rem;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

button:hover:not(:disabled),
.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button--primary,
#download {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 76, 129, 0.18);
  border-color: var(--brand);
}

.button--primary:hover,
#download:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.button--secondary,
#clearSecondaryGraphic {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}

.button--secondary:hover,
#clearSecondaryGraphic:hover:not(:disabled) {
  background: var(--surface-alt);
}

/* Tom Select */

.ts-wrapper {
  max-width: 100%;
  width: 100%;
}

.ts-control {
  border-radius: 12px !important;
  border-color: var(--border-strong) !important;
  padding: 0.72rem 0.95rem !important;
  min-height: 46px !important;
  box-shadow: none !important;
}

.ts-control.focus {
  border-color: rgba(15, 76, 129, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.12) !important;
}

.ts-dropdown {
  z-index: 10000 !important;
  max-height: 320px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-radius: 12px !important;
  border-color: var(--border-strong) !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
}

.ts-dropdown .option,
.ts-dropdown .optgroup-header {
  white-space: normal;
  word-break: break-word;
}

/* Footer */

.page-footer {
  padding: 0.1rem 0.2rem 0;
  font-size: 0.92rem;
}

/* Responsive */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-column {
    position: static;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 1rem, var(--max-width));
    padding-top: 1rem;
  }

  .page-header__inner,
  .guidance-card,
  .preview-card {
    padding: 1rem;
  }

  .form-section {
    padding: 1rem;
  }

  .tool-switcher {
    flex-direction: column;
  }

  .tool-switcher button {
    width: 100%;
  }

  .preview-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header h1 {
    font-size: 1.9rem;
  }

  .ts-dropdown {
    max-height: 260px !important;
  }
}

/* Signature generator brand standards modal */
.brand-standards-modal {
  width: min(520px, 100%);
  border-top: 6px solid rgb(186, 12, 47);
}

.brand-standards-modal__header h2 {
  color: #001489;
  font-size: 1.35rem;
}

.brand-standards-modal__content p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

.brand-standards-modal__footer {
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Change log modal */
.page-header__inner {
  position: relative;
}

.header-changelog-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: var(--pill);
  padding: 0.45rem 0.8rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background var(--transition), border-color var(--transition);
}

.header-changelog-button:hover,
.header-changelog-button:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.42);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal {
  width: min(680px, 100%);
  max-height: min(82vh, 680px);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--text);
}

.modal__header,
.modal__footer {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.modal__footer {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.modal__header h2,
.change-log-entry h3 { margin: 0; }

.modal__close--icon {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}

.modal__close--icon:hover,
.modal__close--icon:focus-visible {
  background: var(--surface-alt);
  color: var(--text);
}

.modal__content {
  padding: 1rem 1.1rem;
  overflow: auto;
}

.change-log-list {
  max-height: min(58vh, 460px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.change-log-entry + .change-log-entry {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.change-log-entry__empty {
  margin: 0.75rem 0 0;
  color: var(--text-soft);
}

.change-log-entry__date {
  margin: 0.35rem 0 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.change-log-entry ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-soft);
  line-height: 1.7;
}

@media (max-width: 720px) {
  .header-changelog-button {
    top: 0.7rem;
    right: 0.7rem;
  }

  .modal {
    max-height: 90vh;
  }
}

/* Recommend page */

.recommend-layout {
  display: block;
  max-width: 760px;
  margin: 0 auto;
}

.option-list {
  display: grid;
  gap: 0.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.form-section .option-row input[type="radio"],
.form-section .option-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: var(--brand);
  box-shadow: none;
}

.form-section .option-row label {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.option-other {
  flex-wrap: wrap;
}

.form-section .option-other input[type="text"] {
  width: auto;
  flex: 1 1 200px;
}

.form-section .option-other input[type="text"]:disabled {
  background: var(--surface-alt);
  cursor: not-allowed;
}

.form-error {
  margin: 0 0 1rem;
  color: var(--danger);
  font-weight: 600;
}

.form-success {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.form-success h2 {
  margin-top: 0;
}

.form-success .button {
  margin-top: 1rem;
}

/* Embed mode: recommend form shown inside the home page modal. */
.embed .page-header {
  display: none;
}

.embed .app-shell {
  width: 100%;
  padding: 1rem 0 1.5rem;
}

.embed .recommend-layout {
  max-width: 100%;
}

.embed .form-success .button {
  display: none;
}

/* Inline text trigger that looks like a link. */
.link-button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
  color: var(--brand-dark);
}

/* Recommend modal iframe (home page). */
.modal--recommend {
  width: min(820px, 100%);
  max-height: 90vh;
}

.modal__content--frame {
  padding: 0;
  overflow: hidden;
}

.recommend-frame {
  display: block;
  width: 100%;
  height: min(78vh, 760px);
  border: 0;
}

