/* ========================================
   RESPONSIVE FORMS STYLES
   Mobile-friendly form enhancements
   ======================================== */

/* Mobile Form Enhancements */
@media (max-width: 768px) {
  /* Form containers */
  .form-card,
  .form-container,
  .setup-form {
    margin: 10px;
    padding: 20px;
    max-width: none;
    width: calc(100% - 20px);
  }
  
  /* Form steps wrapper */
  .steps-wrapper {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
  }
  
  .step-indicator {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
  }
  
  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .step-text {
    font-size: 14px;
    line-height: 1.3;
  }
  
  /* Form inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
  }
  
  input:focus,
  select:focus,
  textarea:focus {
    outline: none;
    border-color: #2d3e35;
    box-shadow: 0 0 0 3px rgba(45, 62, 53, 0.1);
  }
  
  /* Form labels */
  label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3e35;
    margin-bottom: 8px;
    display: block;
  }
  
  /* Form groups */
  .form-group,
  .input-group {
    margin-bottom: 20px;
  }
  
  /* Form buttons */
  .btn,
  .button,
  input[type="submit"],
  button[type="submit"] {
    font-size: 16px;
    padding: 14px 24px;
    border-radius: 8px;
    min-height: 48px;
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .btn-primary,
  .button-primary {
    background: #2d3e35;
    color: white;
    border: none;
  }
  
  .btn-primary:hover,
  .button-primary:hover {
    background: #1e2922;
  }
  
  .btn-secondary,
  .button-secondary {
    background: #f8f9fa;
    color: #2d3e35;
    border: 1px solid #e0e0e0;
  }
  
  .btn-secondary:hover,
  .button-secondary:hover {
    background: #e9ecef;
  }
  
  /* Form grids */
  .form-grid,
  .form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .form-col,
  .form-field {
    width: 100%;
  }
  
  /* Checkboxes and radio buttons */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: #2d3e35;
  }
  
  .checkbox-group,
  .radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .checkbox-item,
  .radio-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .checkbox-item:hover,
  .radio-item:hover {
    background: #f8f9fa;
    border-color: #2d3e35;
  }
  
  .checkbox-item input:checked + label,
  .radio-item input:checked + label {
    color: #2d3e35;
    font-weight: 600;
  }
  
  /* File upload */
  .file-upload {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .file-upload:hover {
    border-color: #2d3e35;
    background: #f0f9f5;
  }
  
  .file-upload input[type="file"] {
    display: none;
  }
  
  /* Form validation */
  .form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
  }
  
  .form-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 4px;
    display: block;
  }
  
  input.error,
  select.error,
  textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
  }
  
  input.success,
  select.success,
  textarea.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
  }
  
  /* Form help text */
  .form-help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: block;
  }
  
  /* Required field indicator */
  .required {
    color: #dc3545;
  }
  
  /* Form sections */
  .form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .form-section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2d3e35;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
  }
  
  /* Multi-step forms */
  .form-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 10px;
  }
  
  .form-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
  }
  
  .form-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    right: -40%;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
  }
  
  .form-step.active::after {
    background: #2d3e35;
  }
  
  .form-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
  }
  
  .form-step.active .form-step-circle {
    background: #2d3e35;
    color: white;
  }
  
  .form-step.completed .form-step-circle {
    background: #28a745;
    color: white;
  }
  
  .form-step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.3;
  }
  
  .form-step.active .form-step-label {
    color: #2d3e35;
    font-weight: 600;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .form-card,
  .form-container,
  .setup-form {
    margin: 5px;
    padding: 15px;
    width: calc(100% - 10px);
  }
  
  .steps-wrapper {
    padding: 0 5px;
  }
  
  .step-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .step-text {
    font-size: 13px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    padding: 12px 14px;
    font-size: 16px;
  }
  
  .btn,
  .button,
  input[type="submit"],
  button[type="submit"] {
    padding: 12px 20px;
    font-size: 15px;
  }
  
  .form-section {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .form-section-title {
    font-size: 16px;
    margin-bottom: 15px;
  }
  
  .form-steps {
    padding: 0 5px;
  }
  
  .form-step-circle {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .form-step:not(:last-child)::after {
    top: 18px;
  }
}

/* Mobile-specific form improvements */
@media (max-width: 768px) {
  /* Better touch targets */
  .checkbox-item,
  .radio-item {
    min-height: 48px;
  }
  
  /* Improved form spacing */
  .form-group:last-child {
    margin-bottom: 0;
  }
  
  /* Mobile-friendly select dropdowns */
  select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
  }
  
  /* Mobile form animations */
  .form-section {
    animation: slideInUp 0.3s ease-out;
  }
  
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Mobile form focus improvements */
  input:focus,
  select:focus,
  textarea:focus {
    transform: scale(1.02);
    transition: all 0.2s ease;
  }
  
  /* Mobile button improvements */
  .btn:active,
  .button:active {
    transform: scale(0.98);
    transition: all 0.1s ease;
  }
}
