/**
 * Registration Form Styles for WordPress Theme
 * Handles form layout, validation states, and user feedback
 */

/* Base form styles */
.registration-form,
.medconnect-registration-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-fields {
    display: block;
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Input with icons */
.form-field .input-with-icon {
    position: relative;
}

.form-field .input-with-icon input {
    padding-left: 2.5rem;
}

.form-field .input-with-icon .icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #6b7280;
}

/* Grid layouts */
.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Validation states */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-error-message {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #ef4444;
    display: flex;
    align-items: center;
}

.field-error-message::before {
    content: "⚠";
    margin-right: 0.25rem;
}

.field-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Checkbox and radio styles */
.form-field .checkbox-group,
.form-field .radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field .checkbox-item,
.form-field .radio-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-field .checkbox-item input,
.form-field .radio-item input {
    width: auto;
    margin: 0;
    margin-top: 0.125rem;
}

.form-field .checkbox-item label,
.form-field .radio-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    line-height: 1.5;
}

/* Package selection styles */
.package-selection {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.package-option {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.package-option:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.package-option.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.package-option .package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.package-option .package-title {
    font-weight: 600;
    color: #1f2937;
}

.package-option .package-price {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.125rem;
}

.package-option .package-description {
    color: #6b7280;
    font-size: 0.875rem;
}

.package-option .package-badge {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Multi-step form styles */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.step-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.step-dot.active {
    background: #3b82f6;
    color: white;
}

.step-dot.completed {
    background: #10b981;
    color: white;
}

.step-dot.completed::before {
    content: "✓";
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-prev-step,
.btn-next-step {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-prev-step {
    background: #f3f4f6;
    color: #374151;
}

.btn-prev-step:hover {
    background: #e5e7eb;
}

.btn-next-step {
    background: #3b82f6;
    color: white;
}

.btn-next-step:hover {
    background: #2563eb;
}

.btn-next-step:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Loading states */
.form-loading {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #6b7280;
    font-weight: 500;
}

/* Success and error messages */
.form-success,
.form-error {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.375rem;
    text-align: center;
}

.form-success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

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

.success-message,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.success-icon,
.error-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.success-icon {
    background: #10b981;
    color: white;
}

.error-icon {
    background: #ef4444;
    color: white;
}

.success-message h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.success-message p,
.error-message p {
    margin: 0;
    font-size: 0.875rem;
}

/* Pricing summary */
.pricing-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.pricing-summary h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.pricing-summary ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.pricing-summary li {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    color: #6b7280;
}

.total-price {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: #1f2937;
    text-align: right;
}

/* Submit button */
.form-submit {
    text-align: center;
    margin-top: 2rem;
}

.form-submit button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
}

.form-submit button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.form-submit button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .registration-form,
    .medconnect-registration-form {
        padding: 1rem;
        margin: 1rem;
    }
    
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .package-selection {
        grid-template-columns: 1fr;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-indicator {
        gap: 0.5rem;
    }
    
    .step-dot {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .registration-form,
    .medconnect-registration-form {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .form-field label {
        color: #f9fafb;
    }
    
    .form-field input,
    .form-field select,
    .form-field textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-field input:focus,
    .form-field select:focus,
    .form-field textarea:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }
    
    .package-option {
        border-color: #4b5563;
        background: #374151;
    }
    
    .package-option:hover {
        border-color: #60a5fa;
        background: #4b5563;
    }
    
    .package-option.selected {
        border-color: #60a5fa;
        background: #1e3a8a;
    }
    
    .pricing-summary {
        background: #374151;
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .form-loading,
    .step-navigation,
    .form-submit {
        display: none;
    }
    
    .registration-form,
    .medconnect-registration-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .form-step {
        display: block !important;
    }
}