/* Shadcn-inspired Form Styles */
:root {
  --shadcn-background: 0 0% 100%;
  --shadcn-foreground: 222.2 84% 4.9%;
  --shadcn-card: 0 0% 100%;
  --shadcn-card-foreground: 222.2 84% 4.9%;
  --shadcn-popover: 0 0% 100%;
  --shadcn-popover-foreground: 222.2 84% 4.9%;
  --shadcn-primary: 221.2 83.2% 53.3%;
  --shadcn-primary-foreground: 210 40% 98%;
  --shadcn-secondary: 210 40% 96%;
  --shadcn-secondary-foreground: 222.2 84% 4.9%;
  --shadcn-muted: 210 40% 96%;
  --shadcn-muted-foreground: 215.4 16.3% 46.9%;
  --shadcn-accent: 210 40% 96%;
  --shadcn-accent-foreground: 222.2 84% 4.9%;
  --shadcn-destructive: 0 84.2% 60.2%;
  --shadcn-destructive-foreground: 210 40% 98%;
  --shadcn-border: 214.3 31.8% 91.4%;
  --shadcn-input: 214.3 31.8% 91.4%;
  --shadcn-ring: 221.2 83.2% 53.3%;
  --shadcn-radius: 0.5rem;
  --shadcn-chart-1: 12 76% 61%;
  --shadcn-chart-2: 173 58% 39%;
  --shadcn-chart-3: 197 37% 24%;
  --shadcn-chart-4: 43 74% 66%;
  --shadcn-chart-5: 27 87% 67%;
}

/* Form Container */
.shadcn-form-container {
  background: #fff;
  border: 1px solid #fff;
  border-radius: calc(var(--shadcn-radius) + 4px);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Form Grid */
.shadcn-form-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
}

/* Form Groups */
.shadcn-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shadcn-form-group.full-width {
  grid-column: 1 / -1;
}

/* Labels */
.shadcn-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--shadcn-foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.25rem;
}

.shadcn-label .required {
  color: hsl(var(--shadcn-destructive));
  margin-left: 0.25rem;
}

.shadcn-label i {
  color: #55a834;
  font-size: 0.875rem;
}

/* Input Styles */
.shadcn-input,
.shadcn-select,
.shadcn-textarea {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--shadcn-input));
  border-radius: calc(var(--shadcn-radius) - 2px);
  background-color: hsl(var(--shadcn-background));
  color: hsl(var(--shadcn-foreground));
  font-size: 0.875rem;
  transition: all 0.15s ease-in-out;
  outline: none;
}

.shadcn-input:focus,
.shadcn-select:focus,
.shadcn-textarea:focus {
  border-color: hsl(var(--shadcn-ring));
  box-shadow: 0 0 0 3px hsl(var(--shadcn-ring) / 0.1);
}

.shadcn-input::placeholder,
.shadcn-textarea::placeholder {
  color: hsl(var(--shadcn-muted-foreground));
}

.shadcn-textarea {
  min-height: 100px;
  padding: 0.75rem;
  resize: vertical;
}

.shadcn-select {
  cursor: pointer;
  appearance: none;
  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;
  padding-right: 2.5rem;
}

/* Checkbox Styles */
.shadcn-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: hsl(var(--shadcn-accent));
  border-radius: var(--shadcn-radius);
  border: 1px solid hsl(var(--shadcn-border));
}

.shadcn-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid hsl(var(--shadcn-border));
  border-radius: 0.25rem;
  background-color: hsl(var(--shadcn-background));
  color: hsl(var(--shadcn-foreground));
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.shadcn-checkbox:focus {
  outline: 2px solid hsl(var(--shadcn-ring));
  outline-offset: 2px;
}

.shadcn-checkbox:checked {
  background-color: hsl(var(--shadcn-primary));
  border-color: hsl(var(--shadcn-primary));
}

.shadcn-checkbox-label {
  font-size: 0.875rem;
  color: hsl(var(--shadcn-foreground));
  line-height: 1.25rem;
  cursor: pointer;
}

/* Button Styles */
.shadcn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 2rem;
  border-radius: var(--shadcn-radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  outline: none;
  border: 1px solid transparent;
}

.shadcn-button-primary {
  background-color: #55a834;
  color: hsl(var(--shadcn-primary-foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.shadcn-button-primary:hover {
  background-color: hsl(var(--shadcn-primary) / 0.9);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.shadcn-button-primary:focus {
  box-shadow: 0 0 0 3px hsl(var(--shadcn-ring) / 0.2);
}

.shadcn-button:disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Form Footer */
.shadcn-form-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--shadcn-border));
  text-align: center;
}

.shadcn-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: hsl(var(--shadcn-muted-foreground));
}

.shadcn-security-note i {
  color: hsl(var(--shadcn-chart-2));
}

/* Loading State */
.shadcn-loading {
  position: relative;
  color: transparent;
}

.shadcn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid hsl(var(--shadcn-background));
  border-radius: 50%;
  border-top-color: hsl(var(--shadcn-foreground));
  animation: shadcn-spin 0.6s linear infinite;
}

@keyframes shadcn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error States */
.shadcn-input.error,
.shadcn-select.error,
.shadcn-textarea.error {
  border-color: hsl(var(--shadcn-destructive));
}

.shadcn-input.error:focus,
.shadcn-select.error:focus,
.shadcn-textarea.error:focus {
  box-shadow: 0 0 0 3px hsl(var(--shadcn-destructive) / 0.1);
}

.shadcn-error-message {
  font-size: 0.75rem;
  color: hsl(var(--shadcn-destructive));
  margin-top: 0.25rem;
}

/* Success States */
.shadcn-success-message {
  padding: 1rem;
  background: hsl(var(--shadcn-chart-2) / 0.1);
  border: 1px solid hsl(var(--shadcn-chart-2) / 0.2);
  border-radius: var(--shadcn-radius);
  color: hsl(var(--shadcn-chart-2));
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .shadcn-form-container {
    padding: 1.5rem;
  }
  
  .shadcn-form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .shadcn-button {
    width: 100%;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --shadcn-background: 222.2 84% 4.9%;
    --shadcn-foreground: 210 40% 98%;
    --shadcn-card: 222.2 84% 4.9%;
    --shadcn-card-foreground: 210 40% 98%;
    --shadcn-popover: 222.2 84% 4.9%;
    --shadcn-popover-foreground: 210 40% 98%;
    --shadcn-primary: 217.2 91.2% 59.8%;
    --shadcn-primary-foreground: 222.2 84% 4.9%;
    --shadcn-secondary: 217.2 32.6% 17.5%;
    --shadcn-secondary-foreground: 210 40% 98%;
    --shadcn-muted: 217.2 32.6% 17.5%;
    --shadcn-muted-foreground: 215 20.2% 65.1%;
    --shadcn-accent: 217.2 32.6% 17.5%;
    --shadcn-accent-foreground: 210 40% 98%;
    --shadcn-destructive: 0 62.8% 30.6%;
    --shadcn-destructive-foreground: 210 40% 98%;
    --shadcn-border: 217.2 32.6% 17.5%;
    --shadcn-input: 217.2 32.6% 17.5%;
    --shadcn-ring: 224.3 76.3% 94.1%;
  }
}
