:root {
  --bg-1: #f5fff8;
  --bg-2: #e8f8ee;
  --bg-3: #d6efdf;
  --glass: rgba(255, 255, 255, 0.76);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(15, 91, 49, 0.24);
  --green-1: #effff2;
  --green-2: #5dde88;
  --green-3: #2dae63;
  --green-4: #12804a;
  --green-5: #0d5f37;
  --green-6: #08351e;
  --text-1: #0b2d1a;
  --text-2: rgba(11, 45, 26, 0.84);
  --text-3: rgba(11, 45, 26, 0.66);
  --shadow: 0 12px 28px rgba(21, 90, 52, 0.1);
  --focus-ring: rgba(18, 128, 74, 0.2);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 128, 74, 0.52) rgba(255, 255, 255, 0.42);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.38);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(45, 174, 99, 0.72), rgba(13, 95, 55, 0.82));
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(45, 174, 99, 0.88), rgba(13, 95, 55, 0.96));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text-1);
  background:
    radial-gradient(circle at top left, rgba(93, 222, 136, 0.42), transparent 34%),
    radial-gradient(circle at bottom right, rgba(18, 128, 74, 0.16), transparent 32%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 25%),
    linear-gradient(280deg, rgba(255, 255, 255, 0.16), transparent 20%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
  opacity: 0.62;
  animation: floatBlob 12s ease-in-out infinite;
}

.ambient-one {
  top: 3%;
  left: -12%;
  width: 180px;
  height: 180px;
  background: rgba(93, 222, 136, 0.34);
}

.ambient-two {
  right: -10%;
  bottom: 18%;
  width: 210px;
  height: 210px;
  background: rgba(45, 174, 99, 0.18);
  animation-duration: 14s;
}

.ambient-three {
  left: 50%;
  bottom: -6%;
  width: 170px;
  height: 170px;
  background: rgba(255, 255, 255, 0.7);
  animation-duration: 16s;
}

.mobile-app {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top))
    16px
    max(18px, env(safe-area-inset-bottom))
    16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  animation: slideDown 0.8s ease both;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(93, 222, 136, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 6px 16px rgba(17, 89, 49, 0.08);
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.brand-mark::before {
  inset: 5px auto auto 6px;
  width: 18px;
  height: 18px;
}

.brand-mark::after {
  right: -6px;
  bottom: -10px;
  width: 28px;
  height: 28px;
  background: rgba(45, 174, 99, 0.24);
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(18, 128, 74, 0.18));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

.brand-copy span:last-child {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghost-button,
.primary-button,
.secondary-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease;
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--green-5);
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  flex: 0 0 auto;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    gap: 8px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .brand-copy strong {
    font-size: 0.94rem;
  }

  .brand-copy span:last-child {
    max-width: 128px;
    font-size: 0.72rem;
  }

  .header-actions {
    gap: 6px;
  }

  .ghost-button {
    min-height: 34px;
    padding-inline: 6px;
    font-size: 0.84rem;
  }
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
}

.glass-card {
  width: 100%;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--glass-strong), var(--glass));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.intro-card,
.form-card {
  grid-area: 1 / 1;
}

.intro-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
  min-height: calc(100dvh - 118px);
  overflow: hidden;
  animation: cardReveal 0.9s 0.12s ease both;
  transition:
    transform 0.7s ease,
    opacity 0.7s ease,
    filter 0.7s ease;
}

.intro-card > * {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

h1,
h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  line-height: 1.02;
}

h1 {
  max-width: 10ch;
  font-size: clamp(2.6rem, 11vw, 4.1rem);
}

.hero-title {
  position: relative;
  display: inline-grid;
  gap: 0.04em;
  max-width: none;
  text-wrap: balance;
}

.hero-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.18em;
  width: 58%;
  height: 0.16em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(93, 222, 136, 0), rgba(45, 174, 99, 0.85), rgba(93, 222, 136, 0));
  transform: translateX(-50%) scaleX(0.2);
  transform-origin: center;
  opacity: 0;
  filter: blur(6px);
  animation: titleUnderline 1.1s 0.95s ease forwards;
}

.hero-title-line {
  display: block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(26px) scale(0.94);
  text-shadow: 0 0 0 rgba(93, 222, 136, 0);
  animation: heroLineReveal 1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.hero-title-line:nth-child(1) {
  animation-delay: 0.05s;
}

.hero-title-line:nth-child(2) {
  animation-delay: 0.28s;
}

.hero-title-line:nth-child(3) {
  animation-delay: 0.5s;
}

.hero-title-accent {
  color: var(--green-5);
  text-shadow: 0 8px 24px rgba(18, 128, 74, 0.14);
  animation:
    heroLineReveal 1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards,
    heroAccentPulse 2.8s 1.35s ease-in-out infinite;
}

h2 {
  font-size: clamp(1.72rem, 6vw, 2.2rem);
}

.section-text,
.helper-text {
  margin: 0;
  line-height: 1.55;
  color: var(--text-2);
}

.section-note {
  margin: 0;
  line-height: 1.55;
  color: var(--green-5);
  font-weight: 700;
}

.form-actions {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 700;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #159455, var(--green-5));
  box-shadow: 0 10px 20px rgba(18, 128, 74, 0.16);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.secondary-button,
.secondary-link {
  color: var(--green-5);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(18, 128, 74, 0.18);
}

.form-card {
  align-self: end;
  width: min(100%, 620px);
  max-height: calc(100dvh - 144px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 16px;
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.section-copy {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

#quoteForm {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.bot-field {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-6);
}

.field-help {
  margin: -2px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-3);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(18, 128, 74, 0.14);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: inherit;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.field textarea {
  resize: none;
  min-height: 124px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(11, 45, 26, 0.48);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(18, 128, 74, 0.38);
  background: #ffffff;
  box-shadow:
    0 0 0 4px var(--focus-ring),
    0 10px 22px rgba(18, 128, 74, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.field input.invalid,
.field textarea.invalid {
  border-color: rgba(191, 62, 62, 0.46);
  background: rgba(255, 247, 247, 0.96);
  box-shadow: 0 0 0 4px rgba(191, 62, 62, 0.08);
}

.helper-text {
  font-size: 0.82rem;
  color: var(--text-3);
}

.toast-popup {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  width: min(calc(100% - 28px), 420px);
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(9, 64, 37, 0.94);
  border: 1px solid rgba(93, 222, 136, 0.28);
  color: #f7fff9;
  line-height: 1.45;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 18px 34px rgba(11, 45, 26, 0.22);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.toast-popup.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-popup.is-error {
  background: rgba(120, 24, 24, 0.94);
  border-color: rgba(255, 183, 183, 0.26);
}

body.show-form .intro-card {
  transform: translateY(-26px) scale(0.98);
  opacity: 0.16;
  filter: blur(8px);
  pointer-events: none;
  transition:
    transform 0.7s ease,
    opacity 0.7s ease,
    filter 0.7s ease;
}

body.show-form .form-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.secondary-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(15, 86, 49, 0.09);
}

.ghost-button:active,
.primary-button:active,
.secondary-button:active,
.secondary-link:active {
  transform: translateY(0);
}

.ghost-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.secondary-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.ghost-button:hover,
.ghost-link:hover {
  color: var(--green-6);
  box-shadow: none;
}

@media (min-width: 720px) {
  body {
    overflow-y: auto;
  }

  .mobile-app {
    width: min(100%, 980px);
    padding-inline: 20px;
  }

  .stage {
    align-items: stretch;
  }

  .intro-card {
    min-height: 620px;
    padding: 28px;
  }

  .form-actions {
    grid-template-columns: 1fr 1fr;
  }

  .form-card {
    width: min(100%, 620px);
    justify-self: end;
    padding: 24px;
  }
}

@media (min-width: 1024px) {
  body {
    overflow: hidden;
  }

  .topbar {
    display: none;
  }

  .mobile-app {
    width: min(100%, 1260px);
    height: 100dvh;
    padding:
      max(18px, env(safe-area-inset-top))
      26px
      max(18px, env(safe-area-inset-bottom))
      26px;
    gap: 14px;
  }

  .topbar {
    padding-inline: 4px;
  }

  .brand {
    gap: 16px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .brand-copy strong {
    font-size: 1.08rem;
  }

  .brand-copy span:last-child {
    font-size: 0.82rem;
  }

  .ghost-button {
    min-height: 42px;
    padding-inline: 16px;
  }

  .stage {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
    min-height: 0;
    flex: 1;
  }

  .intro-card,
  .form-card {
    grid-area: 1 / 1;
  }

  .intro-card {
    min-height: 0;
    width: min(100%, 900px);
    height: auto;
    padding: 32px;
    gap: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hero-copy {
    max-width: 900px;
    gap: 0;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(4.4rem, 8vw, 7.8rem);
  }

  .form-card {
    position: relative;
    top: auto;
    align-self: center;
    justify-self: center;
    width: min(100%, 620px);
    max-width: none;
    min-width: 0;
    min-height: auto;
    height: auto;
    max-height: min(78dvh, 760px);
    padding: 24px 22px 22px;
    overflow: auto;
    border-width: 1px;
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    pointer-events: none;
  }

  #quoteForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .field-wide,
  .form-actions,
  .helper-text,
  .field textarea {
    min-height: 116px;
  }

  body.show-form .intro-card {
    transform: translateY(-24px) scale(0.98);
    opacity: 0;
    filter: blur(8px);
    pointer-events: none;
  }

  body.show-form .form-card {
    padding: 24px 22px 22px;
    border-width: 1px;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}

@media (min-width: 1320px) {
  .intro-card {
    width: min(100%, 1080px);
  }

  h1 {
    font-size: clamp(5rem, 7vw, 8.4rem);
  }

  .form-card {
    width: min(100%, 640px);
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.admin-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text-1);
  background:
    radial-gradient(circle at top left, rgba(93, 222, 136, 0.22), transparent 30%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
}

.admin-shell,
.dashboard-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 16px;
}

.admin-panel,
.quote-card,
.summary-card {
  border-radius: 22px;
  background: linear-gradient(160deg, var(--glass-strong), var(--glass));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.admin-panel {
  width: min(100%, 520px);
  margin: 8vh auto 0;
  padding: 22px;
}

.admin-brand,
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.admin-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.admin-text {
  margin: 18px 0 0;
  color: var(--text-2);
  line-height: 1.55;
}

.admin-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.admin-alert {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 700;
}

.admin-alert-error {
  color: #8f2323;
  background: rgba(255, 240, 240, 0.96);
  border: 1px solid rgba(191, 62, 62, 0.24);
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.summary-card {
  padding: 18px;
}

.summary-card span {
  display: block;
  color: var(--text-3);
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Sora", sans-serif;
  font-size: 2.4rem;
}

.dashboard-list {
  display: grid;
  gap: 12px;
}

.quote-card {
  padding: 18px;
}

.quote-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.quote-card-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.quote-card-head p,
.quote-meta,
.quote-card time,
.quote-empty p {
  margin: 6px 0 0;
  color: var(--text-3);
}

.quote-description {
  margin: 16px 0 0;
  line-height: 1.65;
  color: var(--text-1);
}

.quote-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.quote-whatsapp {
  min-width: 168px;
}

.admin-logout {
  text-decoration: none;
}

@media (min-width: 900px) {
  .admin-shell,
  .dashboard-shell {
    padding: 28px 22px;
  }

  .quote-card {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .dashboard-header,
  .quote-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-actions,
  .quote-card-actions {
    width: 100%;
    justify-content: stretch;
  }

  .dashboard-actions .ghost-button,
  .quote-whatsapp {
    width: 100%;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroLineReveal {
  0% {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(26px) scale(0.94);
  }
  60% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-4px) scale(1.01);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes heroAccentPulse {
  0%,
  100% {
    text-shadow: 0 8px 24px rgba(18, 128, 74, 0.12);
  }
  50% {
    text-shadow:
      0 10px 28px rgba(18, 128, 74, 0.18),
      0 0 22px rgba(93, 222, 136, 0.2);
  }
}

@keyframes titleUnderline {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleX(0.2);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
  }
}

@keyframes floatBlob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -16px, 0);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scaleY(0.94);
    opacity: 0.76;
  }
  50% {
    transform: scaleY(1.04);
    opacity: 1;
  }
}
