/* =============================================
   AJ Clean — Orçamento App
   style.css
   ============================================= */

:root {
  --brand: #0bbdd1;
  --brand-dark: #0898aa;
  --brand-light: #e0f7fa;
  --bg: #d6f3f8;
  --bg2: #b8eaf3;
  --white: #ffffff;
  --ink: #1a2a35;
  --muted: #6b8fa0;
  --line: #d0eaf3;
  --chip-active-bg: #0bbdd1;
  --chip-active-text: #fff;
  --chip-bg: #f0fafd;
  --chip-text: #2a7a8e;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(11,139,161,.12);
  --shadow-lg: 0 16px 48px rgba(11,139,161,.18);
  --font: 'Nunito', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: linear-gradient(160deg, #c2edf6 0%, #a8e4f0 40%, #b8f0e8 100%);
  min-height: 100dvh;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 100px;
  padding-top: 0;
  overflow-x: hidden;
}

/* --- Decorative drops --- */
.drop {
  position: fixed;
  border-radius: 50% 50% 50% 60% / 60% 50% 50% 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.55), rgba(11,189,209,.18));
  backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 0;
  animation: floatDrop 7s ease-in-out infinite;
}
.drop-1 { width:54px; height:64px; top:12%; left:3%; animation-delay:0s; }
.drop-2 { width:38px; height:46px; top:28%; right:4%; animation-delay:1.5s; }
.drop-3 { width:28px; height:34px; top:52%; left:5%; animation-delay:3s; }
.drop-4 { width:44px; height:52px; top:68%; right:6%; animation-delay:4.5s; }
.drop-5 { width:22px; height:27px; top:80%; left:10%; animation-delay:2s; }

@keyframes floatDrop {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}

/* --- App wrapper --- */
.app {
  width: 100%;
  max-width: 440px;
  padding: 0 0 12px;
  position: relative;
  z-index: 1;
  animation: fadeUp .5s ease both;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(24px); }
  to   { opacity:1; transform:translateY(0); }
}

/* --- Logo area --- */
.logo-area {
  text-align: center;
  padding: 32px 20px 20px;
}

.logo-box {
  display: inline-block;
  background: var(--white);
  border-radius: 24px;
  padding: 10px 20px 6px;
  box-shadow: 0 8px 28px rgba(11,189,209,.2), 0 2px 8px rgba(0,0,0,.06);
}

.logo-img {
  width: 210px;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

.logo-tagline {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* --- Page title --- */
.page-title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.5px;
  margin-bottom: 4px;
}

.drop-title {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 18px;
}

.drop-deco {
  width: 18px; height: 22px;
  border-radius: 50% 50% 50% 55% / 55% 50% 50% 50%;
  background: linear-gradient(135deg, #7ee8f3, #0bbdd1);
  opacity: .7;
}
.drop-deco.sm { width:13px; height:16px; opacity:.5; }

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  margin: 0 14px 14px;
  padding: 20px 18px;
  box-shadow: var(--shadow);
  animation: fadeUp .5s ease both;
}
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .24s; }
.card:nth-child(5) { animation-delay: .32s; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}

.card-icon {
  width: 34px; height: 34px;
  background: var(--brand-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}

.card-badge {
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 10px;
  letter-spacing: .3px;
}

/* --- Fields --- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 13px 16px;
  background: #f4fbfd;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  color: var(--ink);
  font-weight: 600;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,189,209,.12);
  background: #fff;
}

.field-input::placeholder { color: #b0ccd6; font-weight: 500; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }

.phone-row {
  display: flex; align-items: center; gap: 0;
  background: #f4fbfd;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.phone-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,189,209,.12);
  background: #fff;
}
.phone-flag {
  display: flex; align-items: center; gap: 5px;
  padding: 0 12px;
  border-right: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.phone-flag span { font-size: 18px; }
.phone-row input {
  flex: 1; background: transparent; border: 0;
  padding: 13px 14px 13px 10px;
  font-size: 15px; font-family: var(--font);
  color: var(--ink); font-weight: 600;
  outline: none;
}

select.field-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230bbdd1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* --- Chips --- */
.chips-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .2s;
  -webkit-appearance: none;
}
.chip:hover { border-color: var(--brand); background: #e0f7fa; }
.chip.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(11,189,209,.3);
  transform: scale(1.04);
}

/* --- Service rows --- */
.service-item {
  background: #f4fbfd;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  position: relative;
}
.service-item:last-child { margin-bottom: 0; }

.service-num {
  position: absolute;
  top: 12px; left: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.service-item-inner { padding-left: 30px; }

.service-qty-price {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.subtotal-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.subtotal-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.subtotal-value { font-size: 15px; font-weight: 800; color: var(--brand-dark); }

.btn-add {
  width: 100%;
  padding: 13px;
  border: 2px dashed var(--brand);
  border-radius: 14px;
  background: transparent;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 12px;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-add:hover { background: var(--brand-light); }

.btn-remove {
  position: absolute;
  top: 10px; right: 10px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fee2e2;
  border: 0;
  color: #dc2626;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: background .2s;
}
.btn-remove:hover { background: #fca5a5; }

/* --- Extras row --- */
.extras-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}

/* --- Technical summary toggle --- */
.tech-toggle {
  background: none; border: none;
  width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 0; font-family: var(--font);
}
.tech-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: none;
}
.tech-body.open { display: block; }
.tech-arrow { color: var(--brand); font-size: 18px; transition: transform .2s; }
.tech-arrow.open { transform: rotate(180deg); }

/* --- Conditions --- */
.guarantee-chips { flex-wrap: wrap; }

/* --- Bottom bar --- */
.bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(11,189,209,.14);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1.5px solid var(--line);
}
.total-area .total-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.total-area .total-value { font-size: 24px; font-weight: 900; color: var(--ink); letter-spacing: -.5px; line-height: 1.1; }

.btn-pdf {
  background: linear-gradient(135deg, #0bbdd1, #069fb1);
  color: #fff;
  border: 0;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 20px rgba(11,189,209,.35);
  transition: transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-pdf:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(11,189,209,.4); }
.btn-pdf:active { transform: scale(.97); }
.pdf-icon {
  width: 22px; height: 22px;
  background: rgba(255,255,255,.25);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

/* --- Validity row --- */
.validity-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --- Availability slots --- */
.btn-add-slot {
  background: none;
  border: 1.5px solid var(--brand);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-add-slot:hover { background: var(--brand); color: #fff; }

.slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.slot-num {
  min-width: 22px; height: 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.slot-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
}
.slot-remove {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fee2e2;
  border: 0;
  color: #dc2626;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.slot-remove:hover { background: #fca5a5; }

/* --- Print / PDF sheet --- */
#pdf-sheet { display: none; }

@media print {
  @page { size: A4 portrait; margin: 14mm 14mm 12mm; }

  body { background: #fff !important; padding: 0 !important; }
  .app, .bottom-bar, .drop, .drop-deco { display: none !important; }

  #pdf-sheet {
    display: block !important;
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    color: #1a2a35;
    width: 100%;
  }

  .ps-header {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2.5px solid #0bbdd1;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }
  .ps-logo { width: 120px; height: auto; display: block; }
  .ps-header-info { flex: 1; }
  .ps-company-name { font-size: 12px; font-weight: 900; color: #0898aa; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; line-height: 1.3; }
  .ps-company-detail { font-size: 9px; color: #1a2a35; font-weight: 600; line-height: 1.6; }

  .ps-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
  .ps-box { border: 1px solid #d0eaf3; border-radius: 8px; padding: 9px 11px; }
  .ps-box-title { font-size: 10px; font-weight: 800; color: #0898aa; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid #d0eaf3; padding-bottom: 5px; margin-bottom: 7px; }
  .ps-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
  .ps-field { flex: 1; }
  .ps-label { font-size: 8.5px; color: #6b8fa0; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 1px; }
  .ps-value { font-size: 11px; font-weight: 700; color: #1a2a35; min-height: 14px; border-bottom: 1px solid #e5f0f5; padding-bottom: 2px; }

  .ps-section-title { font-size: 11px; font-weight: 900; color: #0898aa; text-transform: uppercase; letter-spacing: .5px; border-left: 3px solid #0bbdd1; padding-left: 7px; margin: 10px 0 6px; }
  .ps-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
  .ps-table th { background: #e8f7fb; color: #0898aa; font-weight: 800; text-align: left; padding: 6px 8px; border: 1px solid #c5e8f2; font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; }
  .ps-table td { padding: 7px 8px; border: 1px solid #d0eaf3; color: #1a2a35; font-weight: 600; vertical-align: middle; }
  .ps-table tr:nth-child(even) td { background: #f5fbfd; }

  .ps-totals { display: flex; justify-content: flex-end; margin-top: 6px; }
  .ps-totals-box { border: 1px solid #d0eaf3; border-radius: 8px; overflow: hidden; min-width: 260px; }
  .ps-total-row { display: flex; justify-content: space-between; padding: 5px 12px; font-size: 10.5px; border-bottom: 1px solid #d0eaf3; }
  .ps-total-row:last-child { border-bottom: 0; }
  .ps-total-row.grand { background: #0bbdd1; color: #fff; font-weight: 900; font-size: 13px; padding: 7px 12px; }
  .ps-total-row .tl { color: #6b8fa0; font-weight: 700; }
  .ps-total-row.grand .tl { color: rgba(255,255,255,.85); }
  .ps-total-row .tv { font-weight: 800; color: #1a2a35; }
  .ps-total-row.grand .tv { color: #fff; }

  .ps-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
  .ps-tech { font-size: 9.5px; color: #6b8fa0; line-height: 1.55; }

  .ps-footer { margin-top: 12px; padding-top: 8px; border-top: 1px dashed #c5e8f2; font-size: 8.5px; color: #6b8fa0; text-align: center; line-height: 1.6; }
  .ps-footer strong { color: #0898aa; }
}

/* --- Load animations --- */
.card { opacity: 0; animation: fadeUp .45s ease forwards; }
.logo-area { opacity: 0; animation: fadeUp .4s ease forwards; animation-delay: 0s; }
.card:nth-child(1) { animation-delay: .05s; }
.card:nth-child(2) { animation-delay: .1s; }
.card:nth-child(3) { animation-delay: .15s; }
.card:nth-child(4) { animation-delay: .2s; }
.card:nth-child(5) { animation-delay: .25s; }
.card:nth-child(6) { animation-delay: .3s; }
