/* ============================================================
   COMPONENTS.CSS
   Reusable UI pieces: buttons, forms, survey popup, toasts
   ============================================================ */

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.85rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  font-style: italic;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  min-height: 2.875rem;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn--primary {
  background-color: var(--velez-blue-main);
  color: #fff;
  border-color: var(--velez-blue-main);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3),
              0 6px 10px -6px rgba(0, 0, 0, 0.2);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background-color: var(--velez-blue-secondary);
  border-color: var(--velez-blue-secondary);
  box-shadow: 0 14px 25px -5px rgba(0, 0, 0, 0.4);
}

.btn--outline {
  border: 2px solid #ffffff;
  color: #ffffff;
  background: transparent;
}

.btn--outline:hover {
  background: var(--velez-blue-main);
  border-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

/* ── Form ─────────────────────────────────────────────────── */
.proyecto-form {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.form-field {
  width: 100%;
  background-color: rgba(4, 15, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: outline 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
  min-height: 3rem;
}

.form-field::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.form-field:focus {
  outline: 2px solid #ffffff;
  outline-offset: 0;
  border-color: #ffffff;
  background-color: rgba(4, 15, 34, 0.85);
}

.form-field--textarea {
  height: 8rem;
  min-height: 8rem;
  resize: vertical;
}

.form-submit {
  width: 100%;
  background-color: #fff;
  color: var(--velez-blue-main);
  font-weight: 800;
  padding: 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 3rem;
  border: none;
}

.form-submit:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-error {
  background-color: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #fca5a5;
  display: none;
  margin-bottom: 1rem;
}

.form-error.visible {
  display: block;
}

@media (min-width: 768px) {
  .proyecto-form {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .form-field--full {
    grid-column: 1 / -1;
  }
}

/* ── Survey Widget (Adaptive Docking) ──────────────────────── */
.survey-widget {
  position: fixed;
  right: 3.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-survey, 1000);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Mobile & Tablet Survey Widget Docking (< 768px) */
@media (max-width: 767px) {
  .survey-widget {
    right: 1.25rem;
    bottom: 1.25rem;
    top: auto;
    transform: none;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.75rem;
  }
}

/* Circular trigger button with clean text label underneath */
.survey-bubble {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.survey-exclamation {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--velez-blue-main);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.625rem;
  font-weight: 900;
  line-height: 1;
  border: 1px solid #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

@media (max-width: 767px) {
  .survey-exclamation {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.5rem;
  }
}

/* Expanding Shadow Halo Animation */
.survey-exclamation::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  box-sizing: border-box;
  opacity: 0;
  animation: samsung-shadow-expand 2.2s linear infinite;
}

/* Hover & expanded states */
.survey-bubble:hover .survey-exclamation,
.survey-bubble[aria-expanded="true"] .survey-exclamation {
  transform: scale(1.08);
  background-color: var(--velez-blue-secondary);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  animation: none;
}

.survey-bubble:hover .survey-exclamation::before,
.survey-bubble[aria-expanded="true"] .survey-exclamation::before {
  animation: none;
  opacity: 0;
}

/* Inverted state when passing over dark blue section */
.survey-bubble.survey-bubble--inverted .survey-exclamation {
  background-color: #ffffff;
  color: var(--velez-blue-main);
  border: 2px solid var(--velez-blue-main);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.survey-bubble.survey-bubble--inverted:hover .survey-exclamation,
.survey-bubble.survey-bubble--inverted[aria-expanded="true"] .survey-exclamation {
  background-color: var(--velez-blue-main);
  color: #ffffff;
  border-color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

/* Survey panel */
.survey-panel {
  position: relative;
  width: 22.5rem;
  max-width: calc(100vw - 2.5rem);
  max-height: calc(100dvh - 5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: rgba(4, 15, 34, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(2, 59, 239, 0.2);
  padding: 1.625rem;
  box-sizing: border-box;
  animation: survey-panel-reveal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes survey-panel-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.survey-panel[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .survey-panel {
    padding: 1.25rem 1rem;
  }
}

/* Close button inside panel */
.survey-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  width: 1.75rem;
  height: 1.75rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.survey-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* Survey content */
.survey-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.65rem;
  background-color: rgba(2, 59, 239, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
  font-style: italic;
}

.survey-title {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2.5vw, 1.1875rem);
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.survey-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.survey-option {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  background-color: rgba(7, 66, 138, 0.35);
  color: #ffffff;
  cursor: pointer;
  min-height: 2.75rem;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.survey-option:hover {
  transform: translateX(4px);
  background-color: var(--velez-blue-secondary);
  border-color: #ffffff;
  border-left-color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.survey-thank-you {
  padding-block: 1rem;
}

.survey-thank-you__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  color: #ffffff;
  text-transform: uppercase;
}

.survey-thank-you__text {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
}

.survey-thank-you__choice {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
}

.survey-ended-notice {
  padding: 0.75rem;
  background-color: rgba(4, 15, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  align-items: center;
  min-width: 16rem;
  max-width: calc(100vw - 3rem);
}

.toast {
  background-color: var(--silver-600);
  color: #fff;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  pointer-events: all;
  animation: toast-in 0.25s ease forwards;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-left: 3px solid transparent;
}

.toast--success {
  border-left-color: #22c55e;
  background-color: #041a0d;
}

.toast--error {
  border-left-color: #ef4444;
  background-color: #260505;
}

.toast.toast--out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(0.5rem); }
}
