/* =========================================================
   Colégio Visão — Campanha "2027 Começa Agora"
   Landing page de captação de matrícula
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/sora-latin-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  /* Campaign colors */
  --color-bg-1: #29122F;
  --color-bg-2: #490B4B;
  --color-bg-3: #A50753;
  --color-yellow: #FFC300;
  --color-orange: #EA6513;

  /* Semantic tokens */
  --color-surface: rgba(41, 18, 47, 0.3);
  --color-surface-soft: rgba(41, 18, 47, 0.56);
  --color-text-dark: #29122F;
  --color-text-body: #5B4462;
  --color-text-on-dark: #FFFFFF;
  --color-text-on-dark-soft: rgba(255, 255, 255, 0.82);
  --color-border: rgba(255, 255, 255, 0.3);
  --color-error: #C0173A;
  --color-error-bg: #FDEBEF;

  /* Type */
  --font-sans: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* Spacing (8pt-ish scale) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radius */
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  /* Elevation */
  --shadow-card: 0 24px 64px -12px rgba(20, 8, 24, 0.55), 0 8px 24px -8px rgba(0, 0, 0, 0.3);
  --shadow-cta: 0 10px 24px -6px rgba(41, 198, 92, 0.45);

  /* Motion */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 240ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  position: relative;
  isolation: isolate;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--color-text-dark);
  min-height: 100dvh;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background: var(--color-bg-1);
}

img { max-width: 100%; display: block; }
h1, p, small { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Animated background ---------- */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 88%, rgba(234, 101, 19, 0.96) 0%, rgba(234, 101, 19, 0.18) 25%, transparent 46%),
    radial-gradient(circle at 74% 24%, rgba(165, 7, 83, 0.9) 0%, rgba(165, 7, 83, 0.28) 34%, transparent 58%),
    linear-gradient(138deg, #29122f 0%, #490b4b 43%, #a50753 72%, #ea6513 112%);
}

.bg-gradient::before,
.bg-gradient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}

.bg-gradient::before {
  width: 75vmax;
  height: 75vmax;
  top: -25%;
  left: -20%;
  background: radial-gradient(circle, #490b4b 0%, transparent 70%);
  opacity: 0.48;
  animation: float-a 24s ease-in-out infinite alternate;
}

.bg-gradient::after {
  width: 65vmax;
  height: 65vmax;
  bottom: -20%;
  right: -15%;
  background: radial-gradient(circle, var(--color-orange) 0%, transparent 70%);
  opacity: 0.2;
  animation: float-b 28s ease-in-out infinite alternate;
}

.bg-contour {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url('../img/contorno.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: max(112rem, 132vw) auto;
  opacity: 0.075;
}

@keyframes float-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(8%, 6%) scale(1.15); }
}

@keyframes float-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-8%, -6%) scale(1.12); }
}

/* ---------- Page layout ---------- */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  min-height: 100vh;
  padding: var(--space-6) var(--space-4) var(--space-4);
  gap: var(--space-4);
}

.card {
  width: 100%;
  max-width: 440px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: var(--space-8) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  width: 150px;
  height: auto;
  aspect-ratio: 421 / 127;
  image-rendering: auto;
  margin-bottom: var(--space-5);
}

.headline {
  width: calc(100% + 32px);
  font-size: clamp(1.24rem, 6vw, 1.55rem);
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-3);
}

.headline-line {
  display: block;
  white-space: nowrap;
}

.headline .highlight {
  display: inline-block;
  color: var(--color-text-dark);
  background: var(--color-yellow);
  padding: 0 0.25em;
  border-radius: 6px;
}

.subtext {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--color-text-on-dark-soft);
  max-width: 34ch;
  margin-bottom: var(--space-6);
}

.subtext strong { color: #FFD16B; font-weight: 650; }

/* ---------- Form ---------- */
.lead-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field-control {
  position: relative;
}

.field-control > label {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: var(--space-4);
  right: var(--space-4);
  pointer-events: none;
  font-size: 0.68rem;
  line-height: 1.15;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
  letter-spacing: 0.015em;
}

.field label .accent {
  color: #FFD16B;
  background: transparent;
  padding: 0;
}

.field select,
.field input {
  width: 100%;
  min-height: 66px;
  padding: 25px var(--space-4) 7px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-on-dark);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'><path d='M4 6l4 4 4-4' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}

.field select:invalid { color: rgba(255, 255, 255, 0.78); }

.field select option,
.field select optgroup {
  color: var(--color-text-dark);
  background: #fff;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.58); }

.field select:focus-visible,
.field input:focus-visible {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 4px rgba(234, 101, 19, 0.18);
}

.field.has-error select,
.field.has-error input {
  min-height: 94px;
  padding-bottom: 34px;
  border-color: var(--color-error);
  background-color: rgba(90, 10, 35, 0.72);
}

.field.has-error .phone-input {
  border-color: var(--color-error);
  background-color: rgba(90, 10, 35, 0.72);
}

.help {
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.68);
}

.field-error {
  position: absolute;
  z-index: 2;
  left: var(--space-4);
  right: var(--space-4);
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  font-size: 0.68rem;
  line-height: 1.25;
  font-weight: 600;
  color: #ff9bad;
}

.field-error::before {
  content: '!';
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff4968;
  color: #fff;
  font-size: 0.62rem;
  line-height: 14px;
  text-align: center;
}

.phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.phone-input:focus-within {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 4px rgba(234, 101, 19, 0.18);
}

.phone-input input {
  border: none;
  background: transparent;
  min-height: 66px;
}

.phone-input input:focus-visible { outline: none; box-shadow: none; }

.honeypot-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.error-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  min-height: 58px;
  margin-top: var(--space-2);
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(105deg, #d9ff63 0%, #7ee45f 48%, #29c65c 100%);
  color: var(--color-text-dark);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-cta);
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard), opacity var(--duration-fast) var(--ease-standard);
}

.cta::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(126, 228, 95, 0.72);
  opacity: 0.55;
  animation: cta-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes cta-pulse {
  0%   { transform: scale(1); opacity: 0.55; }
  70%  { transform: scale(1.08); opacity: 0; }
  100% { transform: scale(1.08); opacity: 0; }
}

.cta:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(41, 198, 92, 0.58); }
.cta:active { transform: translateY(0); }

.cta:disabled {
  opacity: 0.75;
  cursor: default;
  transform: none;
}

.cta:disabled::after { animation: none; opacity: 0; }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(41, 18, 47, 0.25);
  border-top-color: var(--color-text-dark);
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.privacy-note {
  font-size: 0.76rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.64);
  text-align: center;
  margin-top: var(--space-1);
}

/* ---------- Success modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(41, 18, 47, 0.72);
  animation: modal-fade var(--duration-base) var(--ease-standard);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-8) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: modal-in var(--duration-base) var(--ease-standard);
}

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

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-body);
  cursor: pointer;
}

.modal-close:hover { background: var(--color-surface-soft); }

.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.modal-text {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-dark);
  margin-bottom: var(--space-6);
}

.modal-text strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: var(--space-2);
}

.modal-cta {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal {
    animation: none;
  }
}

/* ---------- Footer ---------- */
.page-footer {
  padding: var(--space-4) 0 var(--space-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.page-footer span {
  font-size: 0.78rem;
  color: var(--color-text-on-dark-soft);
  letter-spacing: 0.02em;
}

.standway-link {
  display: block;
  border-radius: 6px;
  transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.standway-link:hover {
  opacity: 0.78;
  transform: translateY(-1px);
}

.standway-link:active { transform: translateY(0); }

.page-footer img {
  width: 118px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.82;
}

/* ---------- Responsive ---------- */
@media (min-width: 480px) {
  .headline { font-size: 1.75rem; }
  .card { padding: var(--space-10) var(--space-8) var(--space-8); }
}

@media (max-width: 767px) {
  .logo {
    transform: translateY(-10px);
    margin-bottom: 10px;
  }
}

@media (min-width: 768px) {
  .page { padding-top: var(--space-10); }
  .card { max-width: 480px; }
  .headline { font-size: 1.9rem; }
  .logo { width: 230px; }
}

/* ---------- Touch target & accessibility helpers ---------- */
button, select, input, label { touch-action: manipulation; }

:focus-visible { outline: 3px solid var(--color-yellow); outline-offset: 2px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-gradient::before,
  .bg-gradient::after,
  .cta::after,
  .spinner {
    animation: none !important;
  }
}
