/* ==============================================================================
   Specification Download Popup Modal & Parsley Form Styles
   Ramsaroop & Sons - Machinery Landing Page
   ============================================================================== */

/* Modal Backdrop & Container */
.spec-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spec-modal.active {
  opacity: 1;
  visibility: visible;
}

.spec-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.spec-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: #111823;
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(2, 132, 199, 0.2);
  padding: 32px 28px;
  z-index: 2;
  box-sizing: border-box;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f1f5f9;
}

.spec-modal.active .spec-modal-dialog {
  transform: translateY(0) scale(1);
}

/* Close Button */
.spec-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spec-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg);
}

/* Header */
.spec-modal-header {
  margin-bottom: 22px;
  padding-right: 28px;
}

.spec-modal-badge {
  display: inline-block;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(2, 132, 199, 0.5);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.spec-modal-title {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.spec-modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Form Elements */
.spec-modal-form .field {
  margin-bottom: 16px;
  position: relative;
}

.spec-modal-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.spec-modal-form label .required-star {
  color: #f43f5e;
}

.spec-modal-form input,
.spec-modal-form select,
.spec-modal-form textarea {
  width: 100%;
  box-sizing: border-box;
  background: #0b1017;
  border: 1px solid #223246;
  border-radius: 6px;
  color: #f8fafc;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.spec-modal-form input:focus,
.spec-modal-form select:focus,
.spec-modal-form textarea:focus {
  border-color: #0284c7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.spec-modal-form input.input-readonly {
  background: #141c28;
  color: #38bdf8;
  font-weight: 600;
  border-color: rgba(2, 132, 199, 0.4);
  cursor: default;
}

.spec-field-hint {
  display: block;
  font-size: 11px;
  color: #38bdf8;
  margin-top: 4px;
}

/* Submit Button */
.btn-spec-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #0284c7;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
  margin-top: 20px;
}

.btn-spec-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-spec-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-spec-submit .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  margin-right: 8px;
}

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

.spec-form-footer-note {
  margin: 12px 0 0 0;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* Hide Google reCAPTCHA badge cleanly */
.grecaptcha-badge {
  visibility: hidden !important;
  display: none !important;
}

/* Parsley error overrides on dark background */
.spec-modal-form .parsley-errors-list li,
.hero-form .parsley-errors-list li {
  color: #f87171 !important;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.spec-modal-form input.parsley-error,
.spec-modal-form textarea.parsley-error,
.hero-form input.parsley-error,
.hero-form select.parsley-error {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
}

.spec-modal-form input.parsley-success,
.spec-modal-form textarea.parsley-success,
.hero-form input.parsley-success,
.hero-form select.parsley-success {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.06) !important;
}

@media (max-width: 600px) {
  .spec-modal-dialog {
    padding: 24px 18px;
  }
  .spec-modal-title {
    font-size: 19px;
  }
}
