/* ============================================
   Autoevaluacion de Criterio Profesional
   Mobile-first, clean, professional
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555;
  --color-accent: #2c3e50;
  --color-accent-hover: #1a252f;
  --color-border: #ddd;
  --color-option-bg: #fff;
  --color-option-hover: #f5f7f9;
  --color-option-selected: #edf2f7;
  --color-option-border-selected: #2c3e50;
  --color-progress: #2c3e50;
  --color-error: #c0392b;
  --color-success: #27ae60;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 600px;
  --transition-speed: 0.4s;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-progress);
  transition: width var(--transition-speed) ease;
}

/* Container */
.container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.25rem 2rem;
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.screen.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.screen.exit {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

.screen-content {
  width: 100%;
  max-width: var(--max-width);
}

.screen-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.tagline {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.subtitle {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.instruction {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  font-style: italic;
}

.question-number {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

/* Form inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.required {
  color: var(--color-error);
}

.optional {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-main);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

.error-msg {
  display: block;
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 0.3rem;
  min-height: 1.2rem;
}

/* Options (radio) */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.option {
  display: flex;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: var(--color-option-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.option:hover {
  background: var(--color-option-hover);
}

.option.selected {
  background: var(--color-option-selected);
  border-color: var(--color-option-border-selected);
}

.option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text);
}

.option-text strong {
  color: var(--color-accent);
  margin-right: 0.15rem;
}

/* Buttons */
.btn {
  display: inline-block;
  width: 100%;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-main);
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-final {
  background: var(--color-accent);
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

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

/* Success / Error icons */
.check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}

.error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-error);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
}

.note {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 0.75rem;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Desktop */
@media (min-width: 640px) {
  .screen {
    align-items: center;
    padding: 4rem 2rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .option {
    padding: 1.1rem 1.25rem;
  }

  .option:hover {
    background: var(--color-option-hover);
  }

  .btn {
    width: auto;
    min-width: 200px;
  }
}
