:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --info-color: #17a2b8;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --bg-light: #f8f9fa;
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.2);
  --border-radius: 10px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--primary-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0;
}

.container {
  max-width: 900px;
  width: 100%;
  margin: 20px auto;
}

.form-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-header {
  background: var(--primary-gradient);
  color: white;
  padding: 30px;
  text-align: center;
}

.form-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.form-header h2 i {
  margin-right: 10px;
}

.form-header p {
  margin: 10px 0 0;
  opacity: 0.9;
  font-size: 16px;
}

.form-body {
  padding: 40px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.form-group.full-width {
  flex: 0 0 100%;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

label i {
  margin-right: 5px;
  color: var(--primary-color);
}

.required:after {
  content: "*";
  color: var(--error-color);
  margin-left: 4px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 15px;
  font-family: "Poppins", sans-serif;
  transition: var(--transition);
  background-color: var(--bg-light);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b0b0b0;
  background-color: white;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  background-color: white;
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

::placeholder {
  color: #aaa;
  font-size: 14px;
  font-weight: 300;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 15px;
  padding-right: 45px;
}

.form-text {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-light);
}

.pago-section {
  background: white;
  border-radius: 16px;
  margin: 25px 0;
  border: 1px solid #eef2f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.pago-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px;
}

.pago-info-col {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 220px;
}

.pago-icono {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pago-icono i {
  font-size: 32px;
  color: #0070ba;
}

.pago-info-content {
  flex: 1;
}

.pago-info-content h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a2c3e;
  letter-spacing: -0.2px;
}

.pago-total {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.total-label {
  font-size: 13px;
  font-weight: 500;
  color: #6c7a8a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-valor {
  font-size: 28px;
  font-weight: 800;
  color: #1a2c3e;
  letter-spacing: -1px;
}

.pago-seguro {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6c7a8a;
}

.pago-seguro i {
  color: #28a745;
  font-size: 12px;
}

.pago-buttons-col {
  flex: 1;
  min-width: 200px;
}

.paypal-wrapper {
  width: 100%;
}

.paypal-button {
  min-height: 44px;
  width: 100%;
}

.paypal-button iframe {
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.error-paypal {
  background: #fef2f2;
  color: #721c24;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  border-left: 4px solid #dc3545;
}

.pago-confirmado {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-radius: 12px;
  padding: 12px 20px;
  margin: 0 24px 24px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.pago-confirmado i {
  font-size: 20px;
  color: #28a745;
  background: white;
  border-radius: 50%;
  padding: 4px;
}

.confirmado-info {
  flex: 1;
}

.confirmado-info strong {
  display: block;
  font-size: 14px;
  color: #155724;
  margin-bottom: 2px;
}

.confirmado-info span {
  font-size: 12px;
  color: #155724;
  opacity: 0.9;
  word-break: break-all;
}

.button-container {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn-submit,
.btn-reset {
  flex: 1;
  min-width: 200px;
  padding: 16px 30px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-reset {
  background: white;
  color: var(--text-color);
  border: 2px solid var(--border-color);
}

.btn-reset:hover {
  background: var(--bg-light);
  border-color: #b0b0b0;
  transform: translateY(-2px);
}

.mensaje {
  padding: 16px 20px;
  margin-bottom: 25px;
  border-radius: var(--border-radius);
  font-weight: 500;
  display: none;
  animation: slideDown 0.3s ease-out;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mensaje i {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.mensaje-content {
  flex: 1;
  line-height: 1.5;
}

.mensaje.exito {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.mensaje.exito i {
  color: #28a745;
}

.mensaje.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.mensaje.error i {
  color: #dc3545;
}

.mensaje.warning {
  background: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffc107;
}

.mensaje.warning i {
  color: #ffc107;
}

.mensaje.info {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.mensaje.info i {
  color: #17a2b8;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
  border-color: #ff6b6b;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
  border-color: #51cf66;
}

input.valid,
select.valid {
  border-color: #51cf66;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2351cf66'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

input.invalid,
select.invalid {
  border-color: #ff6b6b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff6b6b'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

#otro_estado_container {
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-row .nombre-solo {
  flex: 1;
  max-width: calc(50% - 10px);
  min-width: 0;
}

@media (max-width: 768px) {
  .form-header {
    padding: 25px 20px;
  }

  .form-header h2 {
    font-size: 24px;
  }

  .form-body {
    padding: 30px 20px;
  }

  .form-row {
    gap: 15px;
    margin-bottom: 15px;
  }

  .form-group {
    min-width: 100%;
  }

  .button-container {
    flex-direction: column;
  }

  .btn-submit,
  .btn-reset {
    min-width: 100%;
  }

  .pago-row {
    flex-direction: column;
    padding: 20px;
  }

  .pago-info-col {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .pago-total {
    justify-content: center;
  }

  .pago-seguro {
    justify-content: center;
  }

  .pago-buttons-col {
    width: 100%;
    text-align: center;
  }

  .paypal-wrapper {
    display: flex;
    justify-content: center;
  }

  .pago-confirmado {
    margin: 0 20px 20px 20px;
  }
}

@media (max-width: 480px) {
  .form-header h2 {
    font-size: 20px;
  }

  .form-header p {
    font-size: 14px;
  }

  label {
    font-size: 13px;
  }

  .btn-submit,
  .btn-reset {
    padding: 14px 20px;
    font-size: 14px;
  }

  .pago-info-col {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .pago-icono {
    width: 48px;
    height: 48px;
  }

  .pago-icono i {
    font-size: 28px;
  }

  .total-valor {
    font-size: 24px;
  }

  .pago-info-content h3 {
    font-size: 15px;
  }

  .mensaje {
    padding: 12px 15px;
  }

  .mensaje i {
    font-size: 18px;
  }

  .mensaje-content {
    font-size: 13px;
  }

  input.valid,
  input.invalid {
    background-size: 16px;
    padding-right: 35px;
  }
}

.foto-opciones {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  justify-content: center;
}

.btn-foto-opcion {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-foto-opcion:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.camara-video {
  width: 100%;
  max-width: 100%;
  border-radius: var(--border-radius);
  margin: 15px auto;
  display: block;
  background: #000;
  object-fit: cover;
  min-height: 300px;
}

.camara-controles {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
}

.btn-capturar,
.btn-cerrar-camara {
  padding: 12px 24px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .btn-capturar,
  .btn-cerrar-camara {
    padding: 15px 30px;
    font-size: 18px;
  }

  .camara-video {
    min-height: 400px;
  }
}

.foto-preview {
  text-align: center;
  padding: 20px;
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  margin-top: 15px;
  animation: fadeIn 0.3s ease-out;
}

.foto-preview img {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.preview-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.preview-info p {
  color: var(--success-color);
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.preview-info p i {
  margin-right: 5px;
  font-size: 14px;
}

.btn-cambiar-foto {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-cambiar-foto:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

.btn-cambiar-foto i {
  font-size: 12px;
}

@media (max-width: 480px) {
  .foto-preview img {
    width: 180px;
    height: 180px;
  }
}
