/* Nimwema Platform - Forms Styles */

/* ============================================
   FORM CONTAINERS
   ============================================ */
.page-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--grey-200);
}

.page-header h1 {
  margin-bottom: var(--space-sm);
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-xl);
}

.form-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--grey-200);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--primary-green);
  border-radius: 2px;
}

/* ============================================
   FORM FIELDS
   ============================================ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--ink-black);
  font-size: 15px;
}

.required {
  color: var(--error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: 16px;
  transition: all var(--transition-fast);
  background: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--paper);
  cursor: not-allowed;
  opacity: 0.6;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: var(--success);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   FORM HELPERS & ERRORS
   ============================================ */
.form-helper {
  font-size: 14px;
  color: var(--grey-700);
  margin-top: var(--space-xs);
  display: block;
}

.form-error {
  font-size: 14px;
  color: var(--error);
  margin-top: var(--space-xs);
  display: none;
  font-weight: 500;
}

.form-error:not(:empty) {
  display: block;
}

.form-success {
  font-size: 14px;
  color: var(--success);
  margin-top: var(--space-xs);
  display: block;
  font-weight: 500;
}

/* ============================================
   RADIO BUTTONS
   ============================================ */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--white);
}

.radio-label:hover {
  border-color: var(--primary-green);
  background: rgba(139, 195, 74, 0.02);
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 24px;
  height: 24px;
  border: 2px solid var(--grey-400);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  margin-top: 2px;
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--primary-green);
  background: var(--white);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--primary-green);
  border-radius: 50%;
}

.radio-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-text strong {
  font-size: 16px;
  color: var(--ink-black);
  display: block;
}

.radio-text small {
  font-size: 14px;
  color: var(--grey-700);
  display: block;
  line-height: 1.4;
}

.radio-label input[type="radio"]:checked ~ .radio-text strong {
  color: var(--primary-green);
}

/* ============================================
   CHECKBOXES
   ============================================ */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--grey-400);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--ink-black);
  font-size: 14px;
  font-weight: 700;
}

/* ============================================
   FORM ACTIONS
   ============================================ */
.form-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--grey-200);
}

.form-actions .btn {
  min-width: 140px;
}

/* ============================================
   AMOUNT QUICK SELECT
   ============================================ */
.amount-quick-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.amount-option {
  padding: var(--space-md);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-input);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--white);
  font-weight: 600;
}

.amount-option:hover {
  border-color: var(--primary-green);
  background: rgba(139, 195, 74, 0.05);
}

.amount-option.selected {
  border-color: var(--primary-green);
  background: var(--primary-green);
  color: var(--ink-black);
}

/* ============================================
   LOADING STATE
   ============================================ */
.form-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid var(--grey-200);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   CONFIRMATION PAGE
   ============================================ */
.confirmation-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
  text-align: center;
  max-width: 600px;
  margin: var(--space-2xl) auto;
}

.confirmation-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 40px;
}

.confirmation-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: var(--space-md);
}

.confirmation-message {
  font-size: 18px;
  color: var(--grey-700);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.confirmation-details {
  background: var(--paper);
  border-radius: var(--radius-input);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  text-align: left;
}

.confirmation-detail {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--grey-200);
}

.confirmation-detail:last-child {
  border-bottom: none;
}

.confirmation-detail-label {
  font-weight: 600;
  color: var(--grey-700);
}

.confirmation-detail-value {
  font-weight: 600;
  color: var(--ink-black);
}

.confirmation-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .form-card {
    padding: var(--space-lg);
  }
  
  .form-actions {
    flex-direction: column-reverse;
  }
  
  .form-actions .btn {
    width: 100%;
  }
  
  .amount-quick-select {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .confirmation-card {
    padding: var(--space-lg);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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