/* ========================================
   FORM COMPONENTS - Custom Styled
   Kongre Form Module UI Components
   ======================================== */

/* Keyframe Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes checkmark {
    0% { stroke-dashoffset: 50; }
    100% { stroke-dashoffset: 0; }
}

/* Custom Radio Button Styles */
.form-radio-custom {
    appearance: none;
    width: 1.375rem;
    height: 1.375rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.form-radio-custom:hover {
    border-color: #0f172a;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1);
}

.form-radio-custom:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.15);
}

.form-radio-custom:checked {
    border-color: #0f172a;
    background-color: #0f172a;
}

.form-radio-custom:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: white;
}

/* Custom Checkbox Styles */
.form-checkbox-custom {
    appearance: none;
    width: 1.375rem;
    height: 1.375rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.form-checkbox-custom:hover {
    border-color: #0f172a;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1);
}

.form-checkbox-custom:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.15);
}

.form-checkbox-custom:checked {
    border-color: #0f172a;
    background-color: #0f172a;
}

.form-checkbox-custom:checked::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 0.35rem;
    height: 0.65rem;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
}

/* Option Card Styles (for radio/checkbox groups) */
.form-option-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-option-card:hover {
    border-color: #0f172a;
    background-color: #fafafa;
}

.form-option-card.selected {
    border-color: #0f172a;
    background-color: #f8fafc;
    box-shadow: 0 0 0 1px #0f172a;
}

/* Primary Button (Submit) - Black style matching Astroship */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: #0f172a;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 160px;
}

.btn-primary:hover {
    background-color: #1e293b;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Secondary Button - Gray/Outline style */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    background-color: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 120px;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.2);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Danger Button - Red style for destructive actions */
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: #dc2626;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 160px;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alert Styles */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    animation: slideInDown 0.3s ease-out;
}

.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.alert-content {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Success Screen Styles */
.success-screen {
    animation: scaleIn 0.4s ease-out;
}

.success-icon-container {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.success-icon-container svg {
    width: 2.5rem;
    height: 2.5rem;
    color: white;
}

.success-icon-container svg path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkmark 0.5s ease-out 0.3s forwards;
}

/* Form Input Enhanced Styles */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: #0f172a;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:hover {
    border-color: #9ca3af;
}

.form-input:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1);
}

.form-input.error {
    border-color: #dc2626;
}

.form-input.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Form Label Styles */
.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.form-label .required,
.required {
    color: #dc2626;
    margin-left: 0.25rem;
}

/* Help Text Styles */
.form-help {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Error Text Styles */
.form-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #dc2626;
    margin-top: 0.5rem;
}

.form-error svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Toggle Switch Enhanced */
.form-toggle {
    position: relative;
    width: 3rem;
    height: 1.625rem;
    background-color: #d1d5db;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.375rem;
    height: 1.375rem;
    background-color: white;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-toggle.active {
    background-color: #0f172a;
}

.form-toggle.active::after {
    transform: translateX(1.375rem);
}

/* Price Badge Styles */
.price-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #059669;
    background-color: #ecfdf5;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* Quantity Stepper */
.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    flex-shrink: 0;
}

.qty-btn:hover:not(:disabled) {
    border-color: #0f172a;
    background-color: #f8fafc;
    color: #0f172a;
}

.qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qty-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
}

/* Section Divider */
.form-section-divider {
    position: relative;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

/* Pricing Summary Card */
.pricing-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.pricing-summary-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: #475569;
}

.pricing-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.75rem;
    border-top: 2px solid #e2e8f0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.pricing-summary-total .price {
    color: #059669;
}

/* File Input Styles */
.form-file-input {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-file-input:hover {
    border-color: #0f172a;
    background-color: #f5f5f5;
}

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

.form-file-input-icon {
    width: 3rem;
    height: 3rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.form-file-input-text {
    font-size: 0.9375rem;
    color: #6b7280;
    text-align: center;
}

.form-file-input-text strong {
    color: #0f172a;
}

