/**
 * Tramite Ultralight
 * Versión ultra-minimalista de la página de inicio de trámite
 * Mantiene coherencia visual con el sitio principal
 */

/* ===== MAIN SECTION ===== */
.tramite-ultralight {
  /* Ajuste para navbar fijo (42px top bar + 76px nav = 118px) */
  padding-top: calc(118px + 60px);
  padding-bottom: 80px;
  min-height: calc(100vh - 118px);
  background: linear-gradient(180deg,
    rgba(248, 250, 252, 1) 0%,
    rgba(241, 245, 249, 0.8) 100%
  );
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .tramite-ultralight {
    padding-top: calc(118px + 40px);
    padding-bottom: 60px;
  }
}

/* ===== WRAPPER ===== */
.tramite-ultralight__wrapper {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== CARD CONTAINER ===== */
.tramite-ultralight__card {
  background: #ffffff;
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08),
              0 1px 3px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.5);
  text-align: center;
}

@media (max-width: 576px) {
  .tramite-ultralight__card {
    padding: 32px 24px;
    border-radius: 12px;
  }
}

/* ===== BADGE ===== */
.tramite-ultralight__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(30, 64, 175, 0.08));
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9999px;
  margin-bottom: 24px;
}

/* ===== TYPOGRAPHY ===== */
.tramite-ultralight__title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tramite-ultralight__subtitle {
  font-size: 18px;
  color: #475569;
  margin: 0 0 32px;
  line-height: 1.5;
}

@media (max-width: 576px) {
  .tramite-ultralight__subtitle {
    font-size: 16px;
    margin-bottom: 28px;
  }
}

/* ===== FORM ===== */
.tramite-ultralight__form {
  margin-bottom: 28px;
}

.tramite-ultralight__input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 576px) {
  .tramite-ultralight__input-group {
    flex-direction: column;
  }
}

/* Input Field */
.tramite-ultralight__input {
  flex: 1;
  height: 56px;
  padding: 0 20px;
  font-size: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
  font-family: 'Roboto', sans-serif;
}

.tramite-ultralight__input:hover {
  border-color: #cbd5e1;
}

.tramite-ultralight__input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tramite-ultralight__input::placeholder {
  color: #94a3b8;
}

/* Submit Button */
.tramite-ultralight__submit {
  height: 56px;
  padding: 0 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
}

.tramite-ultralight__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.tramite-ultralight__submit:active {
  transform: translateY(0);
}

.tramite-ultralight__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 576px) {
  .tramite-ultralight__submit {
    width: 100%;
  }
}

/* Captcha container */
.tramite-ultralight__captcha {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ===== TRUST SIGNALS ===== */
.tramite-ultralight__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tramite-ultralight__trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.tramite-ultralight__trust-item svg {
  color: #3b82f6;
  flex-shrink: 0;
}

.tramite-ultralight__trust-divider {
  color: #cbd5e1;
  font-size: 12px;
}

@media (max-width: 576px) {
  .tramite-ultralight__trust {
    gap: 12px;
  }

  .tramite-ultralight__trust-divider {
    display: none;
  }

  .tramite-ultralight__trust-item {
    font-size: 13px;
  }
}

/* ===== FOOTER LINK ===== */
.tramite-ultralight__footer-link {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

.tramite-ultralight__footer-link a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.tramite-ultralight__footer-link a:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== FORM VALIDATION STYLES ===== */
.tramite-ultralight__input.has-error {
  border-color: #ef4444;
  animation: shake 0.3s ease-in-out;
}

/* Si el contenedor del campo recibe has-error/has-success del plugin, reflejar en el input */
.tramite-ultralight__input-group.has-error .tramite-ultralight__input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.tramite-ultralight__input-group.has-success .tramite-ultralight__input {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.tramite-ultralight__input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Error container estilizado - completamente oculto cuando está vacío */
.tramite-ultralight__error-container {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
  overflow: hidden;
  background: none;
  border: none;
}

.tramite-ultralight__error-container.is-visible {
  display: block;
  min-height: 24px;
  margin-top: 8px;
}

.tramite-ultralight__error-container .help-block {
  display: none !important;
}

small.tramite-ultralight__error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

small.tramite-ultralight__error-message svg {
  flex-shrink: 0;
  color: #dc2626;
}

/* Success state */
.tramite-ultralight__input.has-success {
  border-color: #10b981;
}

.tramite-ultralight__input.has-success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* FormValidation overrides */
.form-group.has-error .help-block {
  display: none !important; /* Ocultamos el help-block default */
}

/* Asegurar que el contenedor NO tenga background cuando está vacío */
.tramite-ultralight__input-wrapper {
  background: transparent;
}

/* ===== LOADING STATE ===== */
.tramite-ultralight__submit .fa-spinner {
  margin-right: 8px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 1200px) {
  .tramite-ultralight__wrapper {
    max-width: 600px;
  }

  .tramite-ultralight__card {
    padding: 56px;
  }
}
