/* ============================================================================
   FORM COMPONENTS - Modern & Beautiful Design
   ============================================================================ */

/* ============================================================================
   FORM CONTAINERS
   ============================================================================ */

.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
}

.form-section {
  margin-bottom: 2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-col {
  flex: 1;
}

/* ============================================================================
   FORM GROUPS
   ============================================================================ */

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.form-label.required::after {
  content: ' *';
  color: #ef4444;
  font-weight: 700;
}

.form-group:focus-within .form-label {
  color: #00ff88;
}

/* ============================================================================
   FORM INPUTS
   ============================================================================ */

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #00ff88;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
  transform: translateY(-1px);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.form-input:focus::placeholder,
.form-textarea:focus::placeholder {
  opacity: 0.5;
}

/* ============================================================================
   INPUT TYPES
   ============================================================================ */

/* Text Input */
.form-input[type="text"],
.form-input[type="email"],
.form-input[type="password"],
.form-input[type="search"],
.form-input[type="url"],
.form-input[type="tel"],
.form-input[type="number"] {
  min-height: 48px;
}

/* Textarea */
.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
  font-family: inherit;
}

.form-textarea:focus {
  min-height: 140px;
}

/* Select */
.form-select {
  cursor: pointer;
  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 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

.form-select:focus {
  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='%2300ff88' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* ============================================================================
   INPUT SIZES
   ============================================================================ */

.form-input-sm,
.form-textarea-sm,
.form-select-sm {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  min-height: 40px;
}

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

.form-input-lg,
.form-textarea-lg,
.form-select-lg {
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  min-height: 56px;
}

.form-textarea-lg {
  min-height: 160px;
}

/* ============================================================================
   INPUT STATES
   ============================================================================ */

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

.form-input:disabled:focus,
.form-textarea:disabled:focus,
.form-select:disabled:focus {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  transform: none;
}

.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success,
.form-textarea.success,
.form-select.success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.form-input.success:focus,
.form-textarea.success:focus,
.form-select.success:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ============================================================================
   FORM HELP TEXT
   ============================================================================ */

.form-help {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.form-help a {
  color: #00ff88;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.form-help a:hover {
  color: #00cc6a;
  text-decoration: underline;
}

.form-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-error::before {
  content: '⚠️';
  font-size: 1rem;
}

.form-success {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-success::before {
  content: '✅';
  font-size: 1rem;
}

/* ============================================================================
   CHECKBOXES & RADIOS
   ============================================================================ */

.form-checkbox,
.form-radio {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.form-checkbox:hover,
.form-radio:hover {
  transform: translateX(2px);
}

.form-checkbox input[type="checkbox"],
.form-radio input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.form-radio input[type="radio"] {
  border-radius: 50%;
}

.form-checkbox input[type="checkbox"]:checked,
.form-radio input[type="radio"]:checked {
  border-color: #00ff88;
  background: #00ff88;
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-weight: bold;
  font-size: 12px;
}

.form-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.form-checkbox input[type="checkbox"]:focus,
.form-radio input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
}

.form-checkbox-label,
.form-radio-label {
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  user-select: none;
}

/* ============================================================================
   INPUT GROUPS
   ============================================================================ */

.input-group {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.input-group:focus-within {
  border-color: #00ff88;
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
}

.input-group .form-input {
  border: none;
  background: transparent;
  border-radius: 0;
  flex: 1;
}

.input-group .form-input:focus {
  box-shadow: none;
  transform: none;
}

.input-group .btn {
  border-radius: 0;
  border: none;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  font-weight: 600;
  transition: all 0.3s ease;
}

.input-group .btn:hover {
  background: rgba(0, 255, 136, 0.2);
  transform: none;
}

.input-group .btn:active {
  transform: none;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   FILE INPUT
   ============================================================================ */

.form-file {
  position: relative;
  display: inline-block;
  cursor: pointer;
  width: 100%;
}

.form-file input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.form-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.form-file-label:hover {
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0, 255, 136, 0.05);
  color: #00ff88;
}

.form-file input[type="file"]:focus + .form-file-label {
  border-color: #00ff88;
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
}

.form-file-icon {
  font-size: 1.5rem;
}

/* ============================================================================
   FORM ACTIONS
   ============================================================================ */

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  flex-wrap: wrap;
}

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

.form-actions-center {
  justify-content: center;
}

.form-actions-left {
  justify-content: flex-start;
}

.form-actions-stretch .btn {
  flex: 1;
}

/* ============================================================================
   FORM VALIDATION
   ============================================================================ */

.form-group.has-error .form-label {
  color: #ef4444;
}

.form-group.has-success .form-label {
  color: #10b981;
}

.form-group.has-warning .form-label {
  color: #f59e0b;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  .form-container {
    padding: 1rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .input-group .form-input {
    border-radius: 0;
  }
  
  .input-group .btn {
    border-radius: 0;
  }
  
  .input-group-text {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 480px) {
  .form-input,
  .form-textarea,
  .form-select {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
  
  .form-input-lg,
  .form-textarea-lg,
  .form-select-lg {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .form-file-label {
    padding: 1.25rem;
    font-size: 0.9rem;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .form-input,
  .form-textarea,
  .form-select,
  .form-checkbox,
  .form-radio,
  .input-group,
  .form-file-label {
    transition: none;
  }
}

@media (prefers-contrast: high) {
  .form-input,
  .form-textarea,
  .form-select {
    border-width: 3px;
  }
  
  .form-checkbox input[type="checkbox"],
  .form-radio input[type="radio"] {
    border-width: 3px;
  }
}

/* ============================================================================
   FOCUS STATES
   ============================================================================ */

.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: none;
}

.form-checkbox input[type="checkbox"]:focus-visible,
.form-radio input[type="radio"]:focus-visible {
  outline: none;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes formShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
  animation: formShake 0.5s ease-in-out;
}

@keyframes formSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.form-group.has-success .form-input,
.form-group.has-success .form-textarea,
.form-group.has-success .form-select {
  animation: formSuccess 0.3s ease-in-out;
}