/* =========================================================================
   SIGNATURE BUILDER LAYOUT
   App-specific CSS only. Styling comes from the Webflow export, and overrides
   to it live in unbreakable-foundation.css. Always reach for variables here.
   ========================================================================= */

/* App shell */
.builder {
  height: 100vh;
  display: flex;
  overflow: hidden;
  background-image: radial-gradient(var(--_colour-theme---grey--300) 1px, transparent 1px);
  background-size: 24px 24px;
}

.builder_icon {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--_colour-theme---grey--300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--_colour-theme---grey--400);
}

/* Sidebar */
.builder_sidebar {
  width: 32rem;
  flex: none;
  margin: 1.5rem;
  padding: 0;
  z-index: 10;
}

.builder_header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--_colour-theme---grey--300);
}

.builder_logo {
  width: 3.6rem;
  height: 3.6rem;
  flex: none;
}

.builder_title {
  font-family: var(--font-family--secondary-font);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.045rem;
  margin-bottom: .2rem;
}

.builder_tagline {
  color: var(--_colour-theme---grey--500);
  font-size: var(--_typography---paragraph--sm);
  margin-bottom: 0;
}

.builder_form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
}

.builder_section + .builder_section {
  margin-top: 1.75rem;
}

.builder_section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.builder_section-title .builder_icon {
  color: var(--_colour-theme---grey--500);
}

.builder_hint {
  color: var(--_colour-theme---grey--500);
  font-size: 1rem;
  margin-top: -.5rem;
  margin-bottom: 1rem;
}

/* Colour pickers, set in a row of three */
.builder_colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.builder_color {
  margin-bottom: 0;
  padding: 0;
  display: block;
  color: var(--_colour-theme---grey--800);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.builder_color input {
  display: block;
  width: 100%;
  height: 3.4rem;
  margin-top: .5rem;
  padding: .35rem;
  border: 1px solid var(--_colour-theme---grey--300);
  border-radius: var(--_sizes---borders--radius-xs);
  background-color: var(--_colour-theme---grey--50);
}

.builder_color input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.builder_color input::-webkit-color-swatch {
  border: none;
  border-radius: var(--_sizes---borders--radius-2xs);
}

/* Social icons inside field labels. They are black, so flip them on dark */
.builder_label-with-icon {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.builder_label-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.u-theme-dark img.builder_label-icon {
  filter: invert(1);
}

/* Sidebar footer */
.builder_actions {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--_colour-theme---grey--300);
}

.builder_meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
  color: var(--_colour-theme---grey--500);
  font-family: var(--font-family--ui-font);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06rem;
  text-transform: uppercase;
}

.builder_versions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
}

.builder_version-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.builder_beta {
  background-color: var(--_colour-theme---amber--100);
  border-color: var(--_colour-theme---amber--300);
  color: var(--_colour-theme---amber--800);
  font-size: .7rem;
  letter-spacing: .06rem;
  padding: .15rem .4rem;
}

.builder_changelog-button {
  color: var(--_colour-theme---general--black);
  font-weight: 600;
  letter-spacing: inherit;
  text-decoration: underline;
  text-transform: inherit;
  text-underline-offset: .15em;
}

.builder_changelog-button:hover {
  color: var(--_colour-theme---grey--500);
}

/* Change log modal. It sits inside .builder_meta, so undo the small caps text */
.changelog {
  font-size: var(--_typography---global--base);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.changelog_title {
  font-family: var(--font-family--secondary-font);
  margin-bottom: 1rem;
}

/* Tabs follow the site's theme switcher */
.changelog_tabs {
  display: flex;
  gap: .143rem;
  margin-bottom: 1rem;
  padding: .214rem;
  border: 1px solid var(--_colour-theme---grey--300);
  border-radius: 1000px;
  background-color: var(--_colour-theme---grey--100);
}

.changelog_tab {
  flex: 1;
  padding: .45rem 1rem;
  border-radius: 1000px;
  color: var(--_colour-theme---grey--500);
  font-family: var(--font-family--ui-font);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  transition: all .2s;
}

.changelog_tab:hover {
  color: var(--_colour-theme---general--black);
}

.changelog_tab:focus-visible {
  outline: 2px solid var(--_colour-theme---primary--500);
  outline-offset: 2px;
}

.changelog_tab[aria-selected="true"] {
  background-color: var(--switch-btn-active-bg);
  color: var(--_colour-theme---general--black);
  box-shadow: var(--_effects---shadow-x) var(--_effects---shadow-y) var(--_effects---shadow-blur) var(--_effects---shadow-size) var(--_effects---shadow-color);
}

.changelog_version {
  padding-top: 1rem;
  border-top: 1px solid var(--_colour-theme---grey--300);
}

.changelog_heading {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}

.changelog_list {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

.changelog_list li {
  font-family: var(--font-family--ui-font);
  font-size: 1.05rem;
  padding-top: .15rem;
  padding-bottom: .15rem;
}

.changelog_version:last-child .changelog_list {
  margin-bottom: 0;
}

/* Preview canvas */
.builder_canvas {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder_status {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-family--ui-font);
  font-size: 1rem;
  font-weight: 500;
}

.builder_preview-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  padding: 5.5rem 2rem 2rem;
}

/* Mock email window */
.email {
  flex: none;
  width: 100%;
  max-width: 50rem;
  height: max-content;
  padding: 0;
}

.email_header {
  background-color: var(--_colour-theme---grey--50);
  border-bottom: 1px solid var(--_colour-theme---grey--300);
  padding: 1rem 1.5rem;
}

.email_dots {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}

.email_dot {
  width: .85rem;
  height: .85rem;
  border-radius: 50%;
}

.email_dot.u-red {
  background-color: var(--_colour-theme---red--500);
}

.email_dot.u-amber {
  background-color: var(--_colour-theme---amber--500);
}

.email_dot.u-green {
  background-color: var(--_colour-theme---green--500);
}

.email_row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-family--ui-font);
  font-size: 1rem;
}

.email_row + .email_row {
  margin-top: .5rem;
}

.email_row-label {
  width: 4.5rem;
  flex: none;
  color: var(--_colour-theme---grey--500);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06rem;
  text-transform: uppercase;
}

.email_recipient {
  background-color: var(--_colour-theme---general--white);
  border: 1px solid var(--_colour-theme---grey--300);
  border-radius: 100px;
  padding: .2rem .8rem;
}

.email_subject {
  font-weight: 500;
}

/* Signatures are read on white, so this stays light in dark mode */
.email_body {
  background-color: var(--_colour-theme---general--white-everywhere);
  color: var(--_colour-theme---general--black-everywhere);
  padding: 2rem;
}

.email_message {
  font-family: var(--font-family--ui-font);
  margin-bottom: 2rem;
}

.email_message p {
  font-size: 1.05rem;
  line-height: 1.6;
}

.email_message p:last-child {
  margin-bottom: 0;
}

/* Keeps the preview sizing like a real email client: the logo cell's padding
   would otherwise shrink the 100px logo */
#signature-preview,
#signature-preview * {
  box-sizing: content-box;
}

#signature-preview img {
  max-width: none;
}

/* Toasts */
.toast {
  position: fixed;
  left: 50%;
  bottom: -100px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.15rem;
  border-radius: var(--_sizes---borders--radius-sm);
  background-color: var(--_colour-theme---general--black);
  color: var(--_colour-theme---general--white);
  box-shadow: 0 .5rem 2rem var(--_colour-theme---effects--modal-shadow);
  font-family: var(--font-family--ui-font);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: bottom .3s, opacity .3s;
}

.toast.is-visible {
  bottom: 2.5rem;
  opacity: 1;
}

.toast.u-error {
  background-color: var(--_colour-theme---red--600);
  color: var(--_colour-theme---general--white-everywhere);
}

.toast_icon {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--_colour-theme---green--500);
  color: var(--_colour-theme---general--black-everywhere);
}

.toast.u-error .toast_icon {
  background-color: var(--_colour-theme---general--white_20);
  color: inherit;
}

.toast_title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.toast_text {
  display: block;
  font-size: .9rem;
  opacity: .8;
}

/* Small screens: stack the form above the preview */
@media screen and (max-width: 767px) {
  .builder {
    height: auto;
    min-height: 100vh;
    flex-direction: column;
    overflow: visible;
  }

  .builder_sidebar {
    width: auto;
    margin: 1rem 1rem 0;
  }

  .builder_form {
    overflow: visible;
  }

  .builder_canvas,
  .builder_preview-scroll {
    overflow: visible;
  }

  .builder_status {
    right: 1rem;
    top: 1rem;
  }

  .builder_preview-scroll {
    padding: 4.5rem 1rem 1rem;
  }

  .email_body {
    padding: 1.25rem;
    overflow-x: auto;
  }
}
