:root {
  color-scheme: light;
  --navy: #071c34;
  --navy-soft: #0c2e4f;
  --blue: #0788b8;
  --cyan: #13b4d7;
  --green: #168a61;
  --ink: #17334d;
  --muted: #65798c;
  --line: #d8e4ec;
  --paper: #f4f8fb;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #174366 0, #0a2742 42%, #071c34 100%);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #27bfe2;
  outline-offset: 3px;
}
.portal-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 22px 16px;
}
.portal-card {
  width: min(100%, 460px);
  overflow: hidden;
  border: 1px solid #b5d5e3;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px #0005;
}
.brand-stage {
  position: relative;
  height: 188px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 75% 0%, #146391 0, transparent 55%),
    linear-gradient(135deg, #07192d 0%, #092b4a 62%, #073857 100%);
}
.brand-stage::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .22;
  background: url("assets/identidade-visual/marca-dagua-servicos-v1.svg") center / 100% 100% no-repeat;
}
.brand-logo {
  position: absolute;
  z-index: 3;
  left: -4px;
  bottom: 2px;
  width: 53%;
  display: block;
}
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-mascot {
  position: absolute;
  z-index: 2;
  left: 34%;
  bottom: -12px;
  width: 43%;
  height: 176px;
  object-fit: contain;
  object-position: bottom center;
  transform: scaleX(-1);
  filter: drop-shadow(0 7px 9px #0007);
  pointer-events: none;
}
.portal-brand-name {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 12px;
  width: 34%;
  padding: 7px 8px 8px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, #061a2dbd, #061a2d75);
  color: #fff;
}
.portal-brand-name p {
  margin: 0 0 4px;
  color: #7de6f7;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .1em;
}
.portal-brand-name h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(23px, 7vw, 31px);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .92;
}
.portal-brand-name h1 span { color: #51d5ef; }
.choice-area {
  padding: 11px 12px 13px;
  background: #eaf2f7;
}
.mode-prompt {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}
.mode-hint {
  margin: 8px 0 0;
  color: #526e82;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.mode-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.mode-mascot {
  display: grid;
  place-items: center;
  align-self: end;
  min-width: 0;
}
.mode-mascot img {
  display: block;
  width: 126px;
  max-width: 118%;
  height: auto;
  margin-bottom: -4px;
  filter: drop-shadow(0 3px 4px #0a284b24);
}
.mode-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 8px 30px 8px 9px;
  border: 1px solid #c5d7e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #f4f8fb 100%);
  color: #31516a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 3px 0 #d4e0e7, 0 5px 10px #071c341c;
  touch-action: manipulation;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, filter .16s ease;
}
.mode-button::after {
  content: '›';
  position: absolute;
  right: 8px;
  top: 50%;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  opacity: .72;
}
.mode-button:hover {
  transform: translateY(-2px);
  border-color: #68b8d0;
  filter: brightness(1.02);
}
.mode-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px #071c3424;
}
.mode-button.is-active {
  border-color: transparent;
  background: linear-gradient(110deg, #087eae, #13acd0);
  color: #fff;
  box-shadow: 0 3px 0 #075e87, 0 6px 13px #0788b84a;
  transform: translateY(-1px);
}
.mode-button.is-active::after {
  content: '✓';
  width: 21px;
  height: 21px;
  border-color: #bdefff;
  background: #ffffff24;
  font-size: 12px;
  opacity: 1;
}
.mode-button.is-active:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px #075e8740;
}
.service-picker {
  display: grid;
  gap: 11px;
  padding: 17px 16px 7px;
}
.section-question {
  margin: 0;
  color: var(--navy);
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 850;
  letter-spacing: -.025em;
  line-height: 1.18;
  text-align: center;
}
.service-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.service-card {
  width: 100%;
  min-height: 104px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px 9px;
  border: 1px solid #d4e0e7;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 7px #0c2e4f0c;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.service-card:hover { border-color: #83bfd1; transform: translateY(-1px); }
.service-card.is-selected {
  border-color: var(--blue);
  background: #f0faff;
  box-shadow: 0 0 0 2px #13b4d733, 0 4px 12px #0c2e4f12;
}
.service-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f4f8;
  color: #087eb8;
}
.service-card-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.service-card-copy { min-width: 0; display: grid; gap: 4px; }
.service-card-copy strong {
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}
.service-card-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.32;
}
.picker-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.portal-form {
  display: grid;
  gap: 13px;
  padding: 8px 18px 18px;
  scroll-margin-top: 12px;
}
.portal-form[hidden] { display: none; }
.selected-service-summary {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 9px 9px 0;
  background: #eef8fb;
  color: #17415d;
  font-size: 12px;
  font-weight: 800;
}
.custom-fields {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid #cfe2ea;
  border-radius: 12px;
  background: #f6fbfd;
}
.custom-fields[hidden] { display: none; }
.portal-form select,
.portal-form input,
.portal-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #cad9e3;
  border-radius: 10px;
  background: #fbfdfe;
  color: #19364f;
  font-size: 15px;
}
.portal-form select {
  appearance: none;
  padding-right: 42px;
  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='%230878a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.portal-form input::placeholder, .portal-form textarea::placeholder { color: #91a2af; }
.portal-form textarea { min-height: 94px; resize: vertical; }
.customer-section {
  display: grid;
  gap: 10px;
  padding: 14px 0 2px;
  border-top: 1px solid #e5edf2;
}
.customer-section h2 {
  margin: 0 0 1px;
  color: #087ca6;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.field-wrap {
  display: grid;
  gap: 5px;
  color: #345168;
  font-size: 12px;
  font-weight: 760;
}
.field-wrap > span { display: flex; align-items: baseline; gap: 6px; }
.field-wrap > span small { color: #8495a3; font-size: 10px; font-weight: 550; }
.whatsapp-fallback[hidden] { display: none; }
.character-count { justify-self: end; color: #8798a5; font-size: 10px; font-weight: 500; }
.availability-note { margin: -2px 0 0; color: #718596; font-size: 10px; line-height: 1.4; }
.send-note {
  margin: 0;
  color: #6e8190;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}
.continue-button {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-radius: 11px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 7px 18px #168a6133;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.continue-button:hover { filter: brightness(1.04); }
.continue-button svg { width: 22px; height: 22px; flex: 0 0 22px; fill: currentColor; }
.send-note { max-width: 390px; justify-self: center; }
.whatsapp-fallback {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b8d7c7;
  border-radius: 9px;
  background: #f0faf5;
  color: #315c47;
  font-size: 11px;
}
.whatsapp-fallback a { color: #087a55; font-weight: 800; }
.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #e7eef2;
  background: #f6f9fb;
  color: #6e8190;
  font-size: 10px;
}
.portal-footer span:first-child { color: #31516a; font-weight: 800; }
@media (min-width: 700px) {
  .portal-card { margin-top: 10px; margin-bottom: 10px; }
}
@media (max-width: 480px) {
  .portal-page { padding: 0; }
  .portal-card { width: 100%; min-height: 100vh; min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .brand-stage { height: 184px; }
}
@media (max-width: 360px) {
  .brand-stage { height: 174px; }
  .brand-logo { width: 55%; left: -8px; bottom: 2px; }
  .brand-mascot { left: 33%; width: 45%; height: 162px; }
  .portal-brand-name { right: 8px; width: 35%; padding: 6px; }
  .portal-brand-name h1 { font-size: 23px; }
  .mode-switch { grid-template-columns: 1fr 1fr; gap: 6px; }
  .mode-mascot { grid-column: 1 / -1; grid-row: 1; }
  .mode-mascot img { width: 112px; margin: -5px 0 -7px; }
  .mode-switch .mode-button[data-mode="repair"] { grid-column: 1; grid-row: 2; }
  .mode-switch .mode-button[data-mode="project"] { grid-column: 2; grid-row: 2; }
  .mode-button { min-height: 54px; padding-inline: 6px; font-size: 11px; }
  .mode-button { padding-right: 26px; }
  .service-picker { padding-inline: 12px; }
  .service-card { min-height: 108px; grid-template-columns: 30px minmax(0, 1fr); gap: 7px; padding: 9px 8px; }
  .service-card-icon { width: 30px; height: 30px; }
  .service-card-icon svg { width: 21px; height: 21px; }
  .service-card-copy strong { font-size: 11px; }
  .service-card-copy small { font-size: 9.5px; }
  .portal-form { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mode-button, .service-card { transition: none; }
}
