/* Marketing-supplied Inter Regular — used for all copy on the tile itself.
   Self-hosted (same origin) so dom-to-image can embed it in downloaded PNGs. */
@font-face {
  font-family: "Inter Tile";
  src: url("/fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  /* Colours */
  --brand-primary-colour: #9024a8;
  --brand-secondary-colour: #e096ff;
  --white: #ffffff;
  --black: #333333;
  --border-light: #e2e8f0;
  --text-muted: #666666;
  --zoom-bg: #222222;

  /* Fixtures */
  --tile-size: 1000px;
  --font-weight: 400;
  --max-screen-width: 1440px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--white);
  font-family: "Inter", sans-serif;
  min-height: 100vh;
}

p,
button,
input {
  font-family: "Inter", sans-serif;
}

.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Tool Header UI */
.tool-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--white);
  z-index: 60;
}

.header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: var(--max-screen-width);
  max-width: 100%;
}

.header-title {
  font-size: 28px;
  font-weight: 400;
  color: #333333;
  min-width: 0;
}

.header-line-device {
  font-weight: 600;
  color: var(--brand-primary-colour);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.header-logo {
  height: 24px;
  width: auto;
}

/* Burger button */
.burger {
  position: relative;
  width: 28px;
  height: 26px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease, top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger span:nth-child(1) {
  top: 3px;
}
.burger span:nth-child(2) {
  top: 12px;
}
.burger span:nth-child(3) {
  top: 21px;
}

.burger.is-open span:nth-child(1) {
  top: 12px;
  transform: rotate(45deg);
}
.burger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.2);
}
.burger.is-open span:nth-child(3) {
  top: 12px;
  transform: rotate(-45deg);
}

/* Brand menu - desktop (header extends downwards) */
.brand-menu {
  position: relative;
  overflow: hidden;
  max-height: 0;
  background: var(--white);
  border-bottom: 1px solid transparent;
  padding: 0 18px;
  transition: max-height 0.5s cubic-bezier(0.17, 0.67, 0.83, 0.67),
    border-color 0.6s ease,
    padding 0.5s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  z-index: 60;
}

.brand-menu.is-open {
  max-height: 240px;
  padding: 40px 18px 44px;
  border-bottom-color: var(--border-light);
}

.brand-menu .brand-menu-inner {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.45s ease 0.2s, transform 0.3s cubic-bezier(0.17, 0.67, 0.83, 0.67) 0.15s;
}

.brand-menu.is-open .brand-menu-inner {
  opacity: 1;
  transform: translateY(0);
}

.brand-menu-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  width: var(--max-screen-width);
  max-width: 100%;
  margin: 0 auto;
}

.brand-option {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.brand-option:hover,
.brand-option.is-active {
  opacity: 1;
  transform: translateY(-2px);
}

.brand-option img {
  height: 26px;
  width: auto;
  display: block;
}

/* Overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 50;
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Mobile slide-out panel */
.brand-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(78vw, 360px);
  background: var(--white);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
}

.brand-panel.is-open {
  transform: translateX(0);
}

.brand-panel-head {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 24px;
}

.panel-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}

.panel-close span {
  position: absolute;
  left: 3px;
  top: 15px;
  width: 26px;
  height: 2px;
  background: var(--black);
}

.panel-close span:first-child {
  transform: rotate(45deg);
}
.panel-close span:last-child {
  transform: rotate(-45deg);
}

.brand-panel-list {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding: 8px 8px 0;
}

.brand-panel-list .brand-option {
  text-align: left;
  padding: 0;
}

.brand-panel-list .brand-option img {
  height: 24px;
}

/* Application Container Layout */
.tool-container {
  display: flex;
  flex: 1;
  width: 100%;
  margin-bottom: 72px;
}

.form-parent-wrapper {
  width: 50%;
  max-height: calc(100vh - 144px);
  display: flex;
  justify-content: end;
  align-items: center;
  padding: 60px 20px;
}

/* Form Styling - Left Column */
.form-wrapper {
  display: grid;
  width: 100%;
  max-width: 698px;
  gap: 24px;
}

.form-instruction {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.form-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.form-group label {
  width: 100px;
  font-size: 14px;
  color: var(--black);
  flex-shrink: 0;
  padding: 8px 0;
}

.form-group input,
.form-group select {
  flex: 1;
  width: 100%;
  height: 48px;
  min-width: 370px;
  padding: 0 16px;
  font-size: 15px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--black);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--brand-primary-colour);
}

/* Salary visibility radio group */
.salary-toggle {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 600px;
  padding-left: 100px;
}

.salary-toggle .radio-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--black);
  cursor: pointer;
}

.salary-toggle input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  min-width: 14px;
  height: 14px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.salary-toggle input[type="radio"]:checked {
  border-color: var(--brand-primary-colour);
  background: var(--brand-primary-colour);
  box-shadow: inset 0 0 0 3px var(--white);
}

.input-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.validation-message {
  min-height: 18px;
  margin-top: 4px;
  font-size: 12px;
  color: #dc2626;
}

.validation-message.valid {
  color: var(--valid-colour, var(--brand-primary-colour));
  padding-left: 10px;
  font-size: 1.4rem;
  line-height: 1;
}

.input-error {
  border-color: #dc2626 !important;
}

.input-valid {
  border-color: var(--valid-colour, var(--brand-primary-colour)) !important;
}

/* Brewer Morris' primary is red, which clashes with error styling */
[data-brand="bm"] {
  --valid-colour: var(--brand-secondary-colour);
}

/* Error messages always sit below the input, aligned with it */
.validation-message.error {
  flex: 0 0 100%;
  width: 100%;
  padding-left: 100px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  animation: modal-fade 0.25s ease;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 28px 24px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  animation: modal-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--black);
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Preview Area - Right Column */
.tile-wrapper {
  position: relative;
  width: 50%;
  height: calc(100vh - 144px);
  background-color: #fafafa;
  border-left: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  overflow: hidden;
}

/* Zoom Control HUD Layer */
.zoom-controls {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  background-color: var(--zoom-bg);
  border-radius: 4px;
  padding: 2px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zoom-controls button {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background-color 0.3s ease, border 0.3s ease;
}

.zoom-controls button:hover {
  background-color: var(--brand-primary-colour);
}

.zoom-controls button:first-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* The Tile Design (Maintained Native Specs) */
.tile {
  position: relative;
  width: var(--tile-size);
  height: var(--tile-size);
  min-width: var(--tile-size);
  min-height: var(--tile-size);
  background: var(--brand-primary-colour);
  color: var(--white);
  overflow: hidden;
  padding: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
}

/* Pattern Elements */
.pattern {
  position: absolute;
  width: 430px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.pattern-top {
  top: -5px;
  left: -5px;
}

.pattern-bottom {
  right: -5px;
  bottom: -65px;
  transform: rotate(180deg);
}

/* Logo Section*/
.logo-section {
  display: flex;
  align-items: stretch;
  justify-content: end;
  width: 100%;
  padding-bottom: 32px;
}

.logo {
  height: 100px;
  width: auto;
}

/* Job Section */
.job-section {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.job-wrapper {
  display: flex;
  align-items: stretch;
  gap: 40px;
  width: 100%;
  transform: translateY(-30px);
}

.accent-line {
  width: 7px;
  background: var(--brand-secondary-colour);
  flex-shrink: 0;
  margin-top: 10px;
  margin-bottom: 6px;
}

.job-content {
  display: flex;
  flex-direction: column;
  gap: 52px;
  text-wrap: balance;
}

.tile,
.job-content h1,
.salary {
  font-family: "Inter Tile", "Inter", sans-serif;
}

.job-content h1 {
  font-size: 80px;
  font-weight: var(--font-weight);
  line-height: 1.1;
}

.job-content h1 span:first-child {
  display: inline;
  color: var(--white);
}

.job-content h1 span#display-location {
  display: block;
  color: var(--brand-secondary-colour);
}

.salary {
  font-size: 40px;
  font-weight: var(--font-weight);
  line-height: 1.4;
}

.salary-range {
  flex: 1;
  display: flex;
  gap: 12px;
  min-width: 370px;
}

.salary-range input {
  min-width: 0;
}

/* Sticky Download Bar Container */
.button-wrapper {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  padding: 16px;
  border-top: 1px solid var(--border-light);
  gap: 16px;
  z-index: 100;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background-color: var(--black);
  border: 1px solid var(--black);
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  transition: all ease 300ms;
}

.button:hover {
  transform: translateY(-2px);
  background-color: var(--brand-primary-colour);
  border: 1px solid var(--brand-primary-colour);
}

/* Clear button distinct styling rules */
.button.clear-button {
  background-color: transparent;
  color: var(--black);
  border: 1px solid var(--border-light);
}

.button.clear-button:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--black);
  transform: translateY(-2px);
}

/* Instantly hide layout text element blocks inside the graphic tile if they have no text string characters */
#display-title:empty,
#display-location:empty,
#display-salary:empty,
#display-currency:empty,
#display-frequency:empty {
  display: none !important;
}

.job-content h1:empty {
  display: none;
}

.salary:has(#display-salary:empty):has(#display-currency:empty):has(
    #display-frequency:empty
  ) {
  display: none;
}

@media (max-width: 1024px) {
  .tool-container {
    flex-direction: column;
    margin-bottom: 72px;
  }

  .form-group {
    max-width: 100%;
  }

  .form-group input,
  .form-group select {
    min-width: 100%;
  }

  .form-group small.valid {
    position: absolute;
    top: 0;
    right: 0;
  }

  .form-parent-wrapper {
    width: 100%;
    max-height: none;
    justify-content: center;
  }

  .tile-wrapper {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-light);
    padding: 20px;
    min-height: 600px;
  }

  .salary-range {
    min-width: 100%;
  }

  .salary-range input {
    min-width: 0;
  }

  .salary-toggle {
    max-width: 100%;
    padding-left: 0;
  }

  .validation-message.error {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  .tile-wrapper {
    padding: 10px;
  }

  .zoom-controls {
    top: 20px;
    right: 20px;
    transform: none;
  }

  .header-title {
    font-size: 20px;
  }

  .salary-toggle {
    padding-left: 0;
    gap: 20px;
  }
}

  /* Menu responsiveness: dropdown on desktop, slide-out panel on mobile */
  @media (max-width: 1024px) {
    .brand-menu {
      display: none;
    }
  }

  @media (min-width: 1025px) {
    .brand-panel {
      display: none;
    }
  }

/* === Additions (imported per marketing request) === */

/* Hide the horizontal brand logo in the header on very small screens */
@media (max-width: 459px) {
  .header-logo {
    display: none;
  }
}

/* Sign out button in the nav menus */
.signout-option {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  font-family: inherit;
  font-size: 15px;
  color: #333333;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.signout-option:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.signout-option svg {
  display: block;
}

.brand-menu-inner .signout-option {
  margin-left: auto;
}

.brand-panel-list .signout-option {
  margin-top: 28px;
  padding-left: 0;
}
