/* =============================================================
FORMULARIOS MODERNOS - CYBERNOX
==============================================================
Diseño profesional y tecnológico para formularios de contacto.
Enfoque en usabilidad, accesibilidad y experiencia de usuario.
============================================================= */

/* Variables del tema - Modo oscuro */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --border-color: #334155;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: all 0.2s ease-in-out;
  --transition-fast: all 0.15s ease-in-out;
}

/* =============================================================
SECCIÓN CONTACTOS DIRECTOS
============================================================= */
.contacto-directos {
  padding: 4rem 0;
  background: var(--bg-primary);
}

.contacto-directos .container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.contacto-directos h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1rem;
}

.contacto-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contacto-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .contacto-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .contacto-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contacto-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.contacto-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.contacto-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.contacto-card:hover::before {
  transform: scaleX(1);
}

.contacto-icon {
  margin-bottom: 1.25rem;
}

.contacto-icon i {
  font-size: 2rem;
  color: var(--primary-color);
  transition: var(--transition);
}

.contacto-card:hover .contacto-icon i {
  color: var(--primary-color);
  transform: scale(1.1);
}

.contacto-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.contacto-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}

.contacto-link {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.contacto-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.btn-copy {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-copy:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}

.btn-copy:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-copy:active {
  transform: translateY(1px);
}

.btn-copy.copied {
  border-color: var(--success-color);
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
}

.btn-copy.copied::after {
  content: '✓ Copiado';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 600;
}

/* =============================================================
CONTENEDOR PRINCIPAL
============================================================= */
.contacto-formulario {
  padding: 4rem 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: relative;
  overflow: hidden;
}

.contacto-formulario::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.contacto-formulario .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* =============================================================
ENCABEZADO DEL FORMULARIO
============================================================= */
.form-header {
  text-align: center;
  margin-bottom: 3rem;
}

.form-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  position: relative;
}

.form-header h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
  height: 0.25rem;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 0.125rem;
}

.form-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* =============================================================
FORMULARIO MODERNO
============================================================= */
.modern-form {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.modern-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.25rem;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

/* =============================================================
SECCIONES DEL FORMULARIO
============================================================= */
.form-section {
  margin-bottom: 2.5rem;
}

.form-section:last-of-type {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--bg-tertiary);
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
}

/* =============================================================
FILAS Y GRUPOS
============================================================= */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

/* =============================================================
LABELS MODERNOS
============================================================= */
.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.form-label i {
  color: var(--primary-color);
  font-size: 0.875rem;
  width: 1rem;
  text-align: center;
}

/* =============================================================
INPUTS Y TEXTAREAS
============================================================= */
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: var(--transition);
  box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.form-input:hover:not(:focus),
.form-textarea:hover:not(:focus) {
  border-color: var(--primary-light);
}

.form-input:invalid:not(:focus):not(:placeholder-shown),
.form-textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input:valid:not(:focus):not(:placeholder-shown),
.form-textarea:valid:not(:focus):not(:placeholder-shown) {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

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

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* =============================================================
CONTADOR DE CARACTERES
============================================================= */
.form-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* =============================================================
CHECKBOX PERSONALIZADO
============================================================= */
.checkbox-group {
  margin-bottom: 1.5rem;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  flex-shrink: 0;
  margin-top: 0.125rem;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.checkbox-input:focus + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-input:hover + .checkbox-custom {
  border-color: var(--primary-color);
}

.checkbox-text {
  flex: 1;
  padding-top: 0.125rem;
  cursor: default;
}

.checkbox-text a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}

.checkbox-text a:hover {
  text-decoration: none;
}

/* =============================================================
NOTA DE CAMPOS OBLIGATORIOS
============================================================= */
.form-note {
  margin-top: 0.75rem;
  text-align: center;
}

.form-note small {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

/* =============================================================
MENSAJES DE ERROR
============================================================= */
.form-error {
  display: none;
  color: var(--error-color);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

.form-error.show {
  display: block;
  animation: errorSlide 0.3s ease-out;
}

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

/* =============================================================
BOTONES MODERNOS
============================================================= */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  height: 3rem;
  min-width: 12rem;
  position: relative;
  overflow: hidden;
  vertical-align: top;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-md);
  height: 3rem;
  vertical-align: top;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #20ba5a);
  color: white;
  box-shadow: var(--shadow-md);
  height: 3rem;
  vertical-align: top;
}

.btn-whatsapp:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-whatsapp:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn i {
  font-size: 1.125rem;
}

/* =============================================================
ESTADO DEL FORMULARIO
============================================================= */
.form-status {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translateY(1rem);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.form-status.show {
  opacity: 1;
  transform: translateY(0);
}

.form-status.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-sm);
}

.form-status.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: var(--shadow-sm);
}

/* =============================================================
RESPONSIVE DESIGN
============================================================= */
@media (max-width: 767px) {
  .contacto-formulario {
    padding: 2rem 0;
  }
  
  .contacto-formulario .container {
    padding: 0 1rem;
  }
  
  .form-header h2 {
    font-size: 2rem;
  }
  
  .modern-form {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }
  
  .form-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 20rem;
  }
  
  .form-status {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    margin: 0;
  }
}

@media (min-width: 768px) {
  .form-status {
    max-width: 32rem;
    margin: 1.5rem auto 0;
  }
}

/* =============================================================
ANIMACIONES Y EFECTOS
============================================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modern-form {
  animation: fadeInUp 0.6s ease-out;
}

.form-section {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }

/* =============================================================
ESTADOS DE CARGA
============================================================= */
.form-loading {
  position: relative;
  pointer-events: none;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(2px);
  z-index: 10;
  border-radius: var(--radius-xl);
}

.form-loading .btn {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =============================================================
MODO REDUCED MOTION
============================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================
PRINT STYLES
============================================================= */
@media print {
  .contacto-formulario {
    background: white !important;
    color: black !important;
  }
  
  .modern-form {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  
  .btn {
    display: none !important;
  }
  
  .form-status {
    display: none !important;
  }
}