/* ============================================================
   Encuesta de Satisfacción - Styles
   Color Primario: #093276
   Color Secundario: #BD9554
   ============================================================ */

:root {
  --primary: #093276;
  --primary-light: #0b3d8f;
  --primary-dark: #061f4d;
  --secondary: #BD9554;
  --secondary-light: #d4ad6e;
  --secondary-dark: #a07b3e;
  --bg: #f5f7fa;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(9, 50, 118, 0.08);
  --shadow-lg: 0 8px 40px rgba(9, 50, 118, 0.12);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* ---- Container ---- */
.survey-container {
  max-width: 900px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  overflow: hidden;
}

/* ---- Header ---- */
.survey-header {
  text-align: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.logo-wrapper {
  display: inline-block;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.logo {
  height: 56px;
  width: auto;
  display: block;
}

.survey-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* ---- Progress Bar ---- */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Step Dots ---- */
.step-indicators {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.step-dot.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
}

.step-dot.completed {
  border-color: var(--secondary);
  background: var(--secondary);
  color: var(--white);
}

/* ---- Screens ---- */
.screens-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen {
  position: absolute;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.screen.exit-left {
  opacity: 0;
  transform: translateX(-60px);
  pointer-events: none;
}

/* ---- Question ---- */
.question-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 36px;
  max-width: 640px;
}

/* ---- Options Grid ---- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 560px;
}

.options-grid.three-options {
  grid-template-columns: repeat(3, 1fr);
  max-width: 640px;
}

/* ---- Option Buttons ---- */
.option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  -webkit-user-select: none;
  user-select: none;
  min-height: 160px;
}

.option-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.option-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow);
}

.option-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(9, 50, 118, 0.04), rgba(189, 149, 84, 0.04));
  box-shadow: 0 0 0 3px rgba(9, 50, 118, 0.15), var(--shadow-lg);
}

.option-icon {
  width: 56px;
  height: 56px;
  color: var(--primary);
  transition: var(--transition);
}

.option-btn.selected .option-icon {
  color: var(--secondary);
}

.emoji-icon {
  width: 72px;
  height: 72px;
}

.option-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

.option-btn.selected .option-label {
  color: var(--primary);
}

/* ---- Thank You ---- */
.thank-you-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.check-animation {
  width: 100px;
  height: 100px;
  margin-bottom: 28px;
}

.circle-anim {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: drawCircle 0.6s ease forwards;
}

.check-anim {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.4s 0.5s ease forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.thank-you-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.thank-you-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---- ID Form (Screen 1) ---- */
.id-form {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-field {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: var(--transition);
  background: var(--white);
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 50, 118, 0.1);
}

.btn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-search svg {
  width: 20px;
  height: 20px;
}

.btn-search:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(9, 50, 118, 0.25);
}

.btn-search:active {
  transform: scale(0.97);
}

/* Asociado Card */
.asociado-card {
  background: var(--white);
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.asociado-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.asociado-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(9, 50, 118, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.asociado-avatar svg {
  width: 26px;
  height: 26px;
}

.asociado-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asociado-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.asociado-email {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-continue, .btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-continue:hover, .btn-submit:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(9, 50, 118, 0.25);
}

.btn-continue:active, .btn-submit:active {
  transform: scale(0.97);
}

.asociado-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

/* ---- Channel Grid (Screen 2) ---- */
.channel-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 700px;
  gap: 12px;
}

.option-btn-sm {
  padding: 18px 12px;
  min-height: 110px;
  gap: 10px;
}

.icon-sm {
  width: 36px;
  height: 36px;
}

.option-btn-sm .option-label {
  font-size: 0.82rem;
  line-height: 1.2;
}

/* Otro input */
.otro-input-wrapper {
  margin-top: 16px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

/* ---- Comment Form (Screen 5) ---- */
.comment-form {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.textarea-field {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 120px;
  max-height: 240px;
  transition: var(--transition);
  background: var(--white);
}

.textarea-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 50, 118, 0.1);
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.char-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-submit {
  width: auto;
  flex-shrink: 0;
}

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--primary-dark);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #c0392b;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .survey-container {
    padding: 20px 20px;
  }

  .logo {
    height: 48px;
  }

  .survey-title {
    font-size: 1.15rem;
  }

  .question-text {
    font-size: 1.05rem;
    margin-bottom: 20px;
  }

  .option-btn {
    padding: 24px 16px;
    min-height: 140px;
  }

  .option-btn-sm {
    padding: 14px 10px;
    min-height: 90px;
  }

  .option-icon {
    width: 48px;
    height: 48px;
  }

  .icon-sm {
    width: 30px;
    height: 30px;
  }

  .emoji-icon {
    width: 60px;
    height: 60px;
  }

  .option-label {
    font-size: 0.9rem;
  }

  .option-btn-sm .option-label {
    font-size: 0.75rem;
  }

  .channel-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .screens-wrapper {
    overflow-y: auto;
  }

  .screen {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .survey-container {
    padding: 16px 14px;
  }

  .logo {
    height: 40px;
  }

  .survey-title {
    font-size: 1rem;
  }

  .question-text {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  .options-grid {
    gap: 10px;
  }

  .option-btn {
    padding: 20px 12px;
    min-height: 120px;
  }

  .option-btn-sm {
    padding: 12px 8px;
    min-height: 80px;
    gap: 6px;
  }

  .option-icon {
    width: 40px;
    height: 40px;
  }

  .icon-sm {
    width: 26px;
    height: 26px;
  }

  .emoji-icon {
    width: 50px;
    height: 50px;
  }

  .channel-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .input-group {
    flex-direction: column;
  }

  .btn-search {
    justify-content: center;
  }
}

/* ---- Landscape Tablet Adjustments ---- */
@media (min-height: 600px) and (orientation: landscape) {
  .survey-container {
    padding: 16px 40px;
  }

  .survey-header {
    margin-bottom: 8px;
  }

  .logo {
    height: 44px;
  }

  .logo-wrapper {
    padding: 8px 20px;
    margin-bottom: 6px;
  }

  .question-text {
    font-size: 1.1rem;
    margin-bottom: 18px;
  }

  .option-btn {
    min-height: 130px;
    padding: 20px 16px;
  }

  .option-btn-sm {
    min-height: 90px;
    padding: 14px 10px;
  }
}

/* ---- Print Hidden ---- */
@media print {
  body { display: none; }
}
