/* ===== KA Event & Design ===== */

:root{
  --black:     #000000;
  --cream:     #F1EFE7;
  --cream-dim: #8f8d86;
  --line:      #2a2a28;
  --error:     #d98b7a;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Jost", "Helvetica Neue", Arial, sans-serif;
}

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

/* Must beat any display rule of ours, or a [hidden] row stays visible */
[hidden]{ display: none !important; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

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


/* ===== HOME ===== */

.home-wrap{
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
}

.logo{
  width: min(280px, 62vw);
  height: auto;
  margin-bottom: 34px;
  animation: fade .9s ease both;
}

@keyframes fade{
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}


/* ===== BUTTONS ===== */

.btn{
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--cream);
  padding: 14px 42px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}

.btn:hover,
.btn:focus-visible{
  background: var(--cream);
  color: var(--black);
}

.btn-block{ width: 100%; }

.btn-ghost{
  border-color: var(--line);
  color: var(--cream-dim);
}

.link-btn{
  background: none;
  border: 0;
  color: var(--cream-dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px;
}
.link-btn:hover{ color: var(--cream); }


/* ===== ACCESS CODE MODAL ===== */

.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal.open{ display: flex; }

.modal-box{
  position: relative;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--line);
  background: var(--black);
  padding: 44px 34px 34px;
  text-align: center;
}

.modal-close{
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  color: var(--cream-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover{ color: var(--cream); }

.modal-title{
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: .04em;
}

.modal-sub{
  margin: 0 0 24px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.code-input{
  text-align: center;
  letter-spacing: .5em;
  font-size: 18px;
}


/* ===== FIELDS ===== */

.input{
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  padding: 13px 14px;
  border-radius: 0;
  transition: border-color .2s ease;
}

.input:focus{
  outline: none;
  border-color: var(--cream);
}

.input::placeholder{
  color: #5b5954;
  opacity: 1;
}

textarea.input{ resize: vertical; }

select.input{
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--cream-dim) 50%),
                    linear-gradient(135deg, var(--cream-dim) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

select.input option{
  background: var(--black);
  color: var(--cream);
}

/* Date picker icon visible on a black background */
.input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1);
  opacity: .6;
  cursor: pointer;
}

.error{
  min-height: 18px;
  margin: 8px 0 14px;
  font-size: 12.5px;
  color: var(--error);
  letter-spacing: .04em;
}


/* ===== INNER HEADER ===== */

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.topbar-logo img{ width: 44px; }


/* ===== QUOTATIONS PAGE ===== */

.page{
  max-width: 660px;
  margin: 0 auto;
  padding: 56px 24px 90px;
}

.page-title{
  font-family: var(--serif);
  font-weight: 400;
  font-size: 42px;
  margin: 0 0 4px;
  letter-spacing: .03em;
}

.page-sub{
  margin: 0 0 40px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.form{
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field{
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.label{
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding: 0;
}

.opt{ text-transform: none; letter-spacing: .04em; }

.hint{
  margin: 0;
  font-size: 12.5px;
  color: var(--cream-dim);
}

.fieldset .hint{ margin: -2px 0 4px; }

.row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.row-3{ grid-template-columns: 1fr 1fr 1fr; }

.fieldset{
  border: 1px solid var(--line);
  padding: 20px 22px 22px;
  gap: 12px;
}


/* ===== IMAGE UPLOAD ===== */

.thumbs{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.thumbs:empty{ display: none; }

.thumb{
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  overflow: hidden;
}

.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-remove{
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border: 0;
  background: rgba(0,0,0,.72);
  color: var(--cream);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}

.thumb-remove:hover{ background: rgba(0,0,0,.95); }

.check{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  cursor: pointer;
}

.check input{
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  flex: none;
  border: 1px solid var(--cream-dim);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
}

.check input::after{
  content: "";
  width: 9px;
  height: 9px;
  background: var(--cream);
  transform: scale(0);
  transition: transform .15s ease;
}

.check input:checked{ border-color: var(--cream); }
.check input:checked::after{ transform: scale(1); }

.check em{ font-style: normal; color: var(--cream-dim); }

.check-name{ flex: 1; }

.check-price{
  font-size: 13.5px;
  color: var(--cream-dim);
  letter-spacing: .04em;
  white-space: nowrap;
}

.actions{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}


/* ===== DECORATION ITEMS ===== */

.decor{
  border: 1px solid var(--line);
  padding: 20px 22px 22px;
  gap: 14px;
}

.decor-heads,
.decor-row{
  display: grid;
  grid-template-columns: 74px 1fr 118px 104px 30px;
  gap: 10px;
  align-items: center;
}

.decor-heads{
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: -4px;
}

.decor-heads .num{ text-align: right; }

.decor-row{ margin-bottom: 10px; }

.decor-row .input{
  padding: 10px 11px;
  font-size: 14px;
}

.decor-line{
  text-align: right;
  font-size: 14.5px;
  color: var(--cream-dim);
  white-space: nowrap;
}

.row-remove{
  background: none;
  border: 1px solid transparent;
  color: var(--cream-dim);
  font-size: 20px;
  line-height: 1;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

.row-remove:hover{
  color: var(--cream);
  border-color: var(--line);
}

.add-btn{
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--line);
  color: var(--cream-dim);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 11px 20px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

.add-btn:hover{
  color: var(--cream);
  border-color: var(--cream-dim);
}

.add-plus{
  font-size: 15px;
  vertical-align: -1px;
  margin-right: 4px;
}

.decor-includes{
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.decor-includes .label{ margin-bottom: 2px; }

.decor-total{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 6px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.decor-total strong{
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--cream);
}


/* ===== GENERATED QUOTATION ===== */

.quote{
  margin-top: 56px;
  border: 1px solid var(--line);
  padding: 34px 30px;
  animation: fade .5s ease both;
}

.quote-head{
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.quote-logo{ width: 68px; flex: none; }

.quote-title{
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  margin: 0;
  letter-spacing: .04em;
}

.quote-issued{
  margin: 2px 0 0;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.quote-list{ margin: 0 0 30px; }

.quote-list > div{
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.quote-list dt{
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-top: 3px;
}

.quote-list dd{
  margin: 0;
  font-size: 16px;
  white-space: pre-line;
}

.quote-table{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  font-size: 15px;
}

.quote-table th,
.quote-table td{
  text-align: left;
  font-weight: 300;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.quote-table thead th{
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-top: 0;
}

.quote-table .num{
  text-align: right;
  white-space: nowrap;
  padding-left: 20px;
}

/* "Decoration" heading inside the item list */
.quote-table tbody .group th{
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-top: 20px;
  padding-bottom: 6px;
  border-bottom: 0;
}

.quote-table tbody .group td{
  border-bottom: 0;
  padding-bottom: 6px;
}

/* Decoration items: description and quantity only, no rule between them */
.quote-table tbody .item th,
.quote-table tbody .item td{
  border-bottom: 0;
  padding: 5px 0;
}

.quote-table tbody .item th{ padding-left: 16px; }

.quote-table tbody .note th{
  color: var(--cream-dim);
  font-size: 13.5px;
  padding-top: 10px;
}

/* The one closing amount for the whole decoration block */
.quote-table tbody .group-total th,
.quote-table tbody .group-total td{ padding-top: 12px; }

.quote-table .sub th,
.quote-table .sub td{
  color: var(--cream-dim);
  font-size: 14px;
}

.quote-table .total th,
.quote-table .total td{
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .03em;
  border-bottom: 0;
  padding-top: 18px;
}


/* ===== INSPIRATION BLOCK ===== */

.inspo{
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.inspo-title{
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: .04em;
}

.inspo-note{
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--cream-dim);
  max-width: 46em;
}

.inspo-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.inspo-grid img{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
}


/* ===== SIGNATURE ===== */

.quote-sign{
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: right;
}

.quote-sign-name{
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: .03em;
  margin: 0;
}

.quote-sign-role{
  margin: 3px 0 0;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cream-dim);
}


/* ===== RESPONSIVE ===== */

@media (max-width: 700px){
  .row-3{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px){
  .row,
  .row-3{ grid-template-columns: 1fr; }
  .page{ padding: 40px 20px 70px; }
  .page-title{ font-size: 34px; }
  .quote-list > div{ grid-template-columns: 1fr; gap: 4px; }
  .quote{ padding: 26px 20px; }

  /* Decoration rows stack: description on top, then qty + price */
  .decor{ padding: 18px; }
  .decor-heads{ display: none; }

  .decor-row{
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  .decor-row .decor-desc{ grid-column: 1 / -1; order: -1; }
  .decor-line{ text-align: left; }
  .row-remove{ justify-self: end; }

}


/* ===== PRINT / PDF =====
   The downloaded quotation keeps the black background of the site.
   No page margin so the black reaches the edge of the sheet; the padding
   lives on .quote instead. */

@page{ margin: 0; }

@media print{

  /* Force the browser to actually print the colors instead of
     dropping backgrounds to save ink */
  *{
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body{
    background: var(--black) !important;
    color: var(--cream) !important;
  }

  .topbar, .form, .page-title, .page-sub, .no-print{ display: none !important; }

  .page{
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .quote{
    margin: 0;
    border: 0;
    padding: 10mm 15mm 8mm;
    animation: none;
  }

  /* Tighter spacing so a quotation with several decoration items
     still fits on one sheet */
  .quote-list{ margin-bottom: 18px; }
  .quote-list > div{ padding: 5px 0; }
  .quote-list dd{ font-size: 14px; }
  .quote-list dt{ font-size: 10.5px; }
  .quote-table{ margin-bottom: 0; font-size: 13.5px; }
  .quote-table th,
  .quote-table td{ padding: 6px 0; }
  .quote-table thead th{ font-size: 10.5px; }
  .quote-table tbody .group th{ padding-top: 12px; font-size: 10.5px; }
  .quote-table tbody .item td{ padding: 3px 0; }
  .quote-table tbody .item th{ padding: 3px 0 3px 16px; }
  .quote-table tbody .note th{ padding-top: 7px; font-size: 12px; }
  .quote-table tbody .group-total th,
  .quote-table tbody .group-total td{ padding-top: 9px; }
  .quote-table .sub th,
  .quote-table .sub td{ font-size: 13px; }
  .quote-table .total th,
  .quote-table .total td{ font-size: 20px; padding-top: 10px; }

  /* Logo centered so it reads clearly in the PDF */
  .quote-head{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .quote-logo{ width: 120px; }

  .quote-title{ font-size: 27px; }
  .quote-issued{ font-size: 10.5px; }

  /* Slightly lighter rules so they stay visible on paper */
  .quote-head,
  .quote-list > div,
  .quote-table th,
  .quote-table td{ border-color: #3c3c39 !important; }

  /* Keep the detail blocks whole. Table rows are deliberately left to
     flow: break-inside on <tr> makes Chrome drop a row onto the next
     page while the rows after it stay behind. */
  .quote-list > div{ break-inside: avoid; }

  /* Subtotal, discount and total always travel together */
  #qTotals{ break-inside: avoid; }

  /* Without this the browser reprints the column headers on every page */
  .quote-table thead{ display: table-row-group; }

  /* When there are images they get their own sheet, so the quotation
     itself always stays whole on the first one. The section is hidden
     when no images were added, and a hidden box forces no break. */
  .inspo{
    break-before: page;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    break-inside: avoid;
  }

  .inspo-grid{
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .inspo-grid img{ break-inside: avoid; }

  .inspo-title{ font-size: 21px; }
  .inspo-note{ font-size: 11.5px; margin-bottom: 14px; }

  .quote-sign{
    margin-top: 28px;
    padding-top: 18px;
    break-inside: avoid;
  }

  .quote-sign-name{ font-size: 22px; }
}
