/* Kyasina Form Styles */

/* Base Input Styles */
.tw-form-input {
  background-color: white;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.375rem;
  color: #111827; /* gray-900 */
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tw-form-input:focus {
  outline: none;
  border-color: #105042; /* brand-blue */
  box-shadow: 0 0 0 3px rgba(16, 80, 66, 0.2);
}

.tw-form-input::placeholder {
  color: #9ca3af; /* gray-400 */
}

/* Input Sizes */
.tw-form-input-sm {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

.tw-form-input-lg {
  font-size: 1.125rem;
  padding: 0.75rem 1rem;
}

/* Select Input */
.tw-form-select {
  background-color: white;
  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 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.375rem;
  color: #111827; /* gray-900 */
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tw-form-select:focus {
  outline: none;
  border-color: #105042; /* brand-blue */
  box-shadow: 0 0 0 3px rgba(16, 80, 66, 0.2);
}

/* Checkbox and Radio */
.tw-form-checkbox,
.tw-form-radio {
  appearance: none;
  background-color: #fff;
  border: 1px solid #d1d5db; /* gray-300 */
  display: inline-block;
  height: 1rem;
  width: 1rem;
  color: #105042; /* brand-blue */
  vertical-align: middle;
  position: relative;
  margin-right: 0.5rem;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tw-form-checkbox {
  border-radius: 0.25rem;
}

.tw-form-radio {
  border-radius: 50%;
}

.tw-form-checkbox:checked {
  background-color: #105042; /* brand-blue */
  border-color: #105042; /* brand-blue */
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.tw-form-radio:checked {
  background-color: #105042; /* brand-blue */
  border-color: #105042; /* brand-blue */
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.tw-form-checkbox:focus,
.tw-form-radio:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 80, 66, 0.2);
}

/* Form Label */
.tw-form-label {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827; /* gray-900 */
  margin-bottom: 0.5rem;
}

/* Form Group */
.tw-form-group {
  margin-bottom: 1.5rem;
}

/* Form Help Text */
.tw-form-help-text {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #6b7280; /* gray-500 */
  margin-top: 0.25rem;
}

/* Form Error */
.tw-form-error {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #dc2626; /* red-600 */
  margin-top: 0.25rem;
}

.tw-form-input-error {
  border-color: #dc2626; /* red-600 */
}

.tw-form-input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Form Success */
.tw-form-success {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #16a34a; /* green-600 */
  margin-top: 0.25rem;
}

.tw-form-input-success {
  border-color: #16a34a; /* green-600 */
}

.tw-form-input-success:focus {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* Form Header */
.tw-form-header {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  color: #105042; /* brand-blue */
  margin-bottom: 1.5rem;
}

/* Form Section */
.tw-form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb; /* gray-200 */
}

.tw-form-section-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.25rem;
  color: #105042; /* brand-blue */
  margin-bottom: 1rem;
}

/* Form Actions */
.tw-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Form Inline */
.tw-form-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Form Grid */
.tw-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.tw-form-col-1 { grid-column: span 1 / span 1; }
.tw-form-col-2 { grid-column: span 2 / span 2; }
.tw-form-col-3 { grid-column: span 3 / span 3; }
.tw-form-col-4 { grid-column: span 4 / span 4; }
.tw-form-col-5 { grid-column: span 5 / span 5; }
.tw-form-col-6 { grid-column: span 6 / span 6; }
.tw-form-col-7 { grid-column: span 7 / span 7; }
.tw-form-col-8 { grid-column: span 8 / span 8; }
.tw-form-col-9 { grid-column: span 9 / span 9; }
.tw-form-col-10 { grid-column: span 10 / span 10; }
.tw-form-col-11 { grid-column: span 11 / span 11; }
.tw-form-col-12 { grid-column: span 12 / span 12; }

/* Responsive Form Grid */
@media (max-width: 768px) {
  /* All columns become full width on mobile */
  .tw-form-col-md-12,
  .tw-form-col-1,
  .tw-form-col-2,
  .tw-form-col-3,
  .tw-form-col-4,
  .tw-form-col-5,
  .tw-form-col-6,
  .tw-form-col-7,
  .tw-form-col-8,
  .tw-form-col-9,
  .tw-form-col-10,
  .tw-form-col-11 {
    grid-column: span 12 / span 12;
  }
  
  /* Larger inputs/selects on mobile for better touch targets */
  .tw-form-input,
  .tw-form-select,
  .tw-form-textarea,
  .form-control,
  .form-select,
  select,
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  input[type="tel"] {
    font-size: 16px !important; /* Prevents iOS zoom */
    padding: 0.65rem 0.75rem !important;
    height: auto !important;
    min-height: 44px !important;
  }
  
  /* Better spacing between form groups on mobile */
  .tw-form-group,
  .form-group,
  .mb-3 {
    margin-bottom: 1rem !important;
  }
  
  /* Form labels on mobile */
  .tw-form-label,
  .form-label,
  label {
    font-size: 0.9rem !important;
    margin-bottom: 0.35rem !important;
  }
}

@media (max-width: 640px) {
  .tw-form-col-sm-12 { grid-column: span 12 / span 12; }
  
  /* Even better spacing on small phones */
  .tw-form-group,
  .form-group,
  .mb-3 {
    margin-bottom: 0.85rem !important;
  }
  
  /* Full width buttons on mobile */
  .btn,
  button[type="submit"],
  input[type="submit"] {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.6rem 1rem !important;
    min-height: 44px !important;
  }
}

/* Form Textarea */
.tw-form-textarea {
  background-color: white;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.375rem;
  color: #111827; /* gray-900 */
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  width: 100%;
  min-height: 6rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tw-form-textarea:focus {
  outline: none;
  border-color: #105042; /* brand-blue */
  box-shadow: 0 0 0 3px rgba(16, 80, 66, 0.2);
}

/* Form File Input */
.tw-form-file {
  display: block;
  width: 100%;
}

.tw-form-file::-webkit-file-upload-button {
  background-color: #105042; /* brand-blue */
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-right: 1rem;
}

.tw-form-file::file-selector-button {
  background-color: #105042; /* brand-blue */
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-right: 1rem;
}
