/*
 * Partner Registration Manager - Form Styles
 * @package PartnerRegistrationManager
 */

/* Reset and base styles - More specific selectors to prevent conflicts */
.prm-form-container,
.prm-form-container * {
    box-sizing: border-box;
}

/* Prevent CSS conflicts with other forms */
.prm-form-container input,
.prm-form-container textarea,
.prm-form-container select,
.prm-form-container button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: inherit;
    text-decoration: none;
    cursor: inherit;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Override only within our form container */

/* Container */
.prm-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

/* Header */
.prm-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.prm-form-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
}

.prm-form-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Progress indicator */
.prm-progress-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active::after,
.progress-step.completed::after {
    background: #007cba;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    font-weight: bold;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: #007cba;
    color: white;
}

.step-label {
    font-size: 12px;
    text-align: center;
    color: #666;
    transition: color 0.3s ease;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: #007cba;
    font-weight: bold;
}

/* Form steps */
.form-step {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-step h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.form-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

/* Form layout */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

/* Labels */
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group label.required::after {
    content: ' *';
    color: #e74c3c;
}

/* Input fields */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* Textarea */
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Select */
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* File upload areas */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: #007cba;
    background: #e3f2fd;
    transform: scale(1.02);
}

.file-upload-area.has-file {
    border-color: #28a745;
    background: #f8fff9;
}

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

.upload-placeholder {
    color: #666;
    pointer-events: none;
}

.upload-icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 15px;
}

.upload-placeholder p {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: #555;
}

.upload-placeholder small {
    color: #888;
    font-size: 12px;
}

/* Upload preview */
.upload-preview {
    margin-top: 15px;
    display: none;
}

.upload-preview.show {
    display: block;
}

.upload-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-preview .file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 10px;
}

.upload-preview .file-name {
    font-weight: 500;
    color: #333;
}

.upload-preview .file-size {
    color: #666;
    font-size: 12px;
}

.upload-preview .remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-preview .remove-file:hover {
    background: #c82333;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    font-weight: normal !important;
    cursor: pointer;
    transition: color 0.3s;
}

.checkbox-item:hover {
    color: #007cba;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-top: 0;
    transform: scale(1.1);
}

.checkbox-item span {
    color: #555;
    font-size: 14px;
}

/* Helper text */
.form-help {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
    line-height: 1.4;
}

/* Error messages */
.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 8px;
    display: none;
    font-weight: 500;
}

.field-error.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Form actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:not(:disabled):active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #545b62 0%, #383d41 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Confirmation sections */
.confirmation-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.confirmation-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.confirmation-item {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

.confirmation-item .label {
    font-weight: 600;
    min-width: 140px;
    color: #555;
    font-size: 14px;
}

.confirmation-item .value {
    color: #333;
    flex: 1;
    word-break: break-word;
}

/* Terms agreement */
.terms-agreement {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal !important;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 3px;
    transform: scale(1.2);
}

.checkbox-label a {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Messages */
.prm-error-message,
.prm-success-message,
.prm-info-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-weight: 500;
}

.prm-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.prm-success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.prm-info-message {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Affiliate-specific styles */
.affiliate-form .affiliate-info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #007cba;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.affiliate-info-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Loading states */
.form-step.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-loading .btn-text {
    display: none;
}

.btn-loading .btn-loading {
    display: flex !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .prm-form-container {
        margin: 10px;
        padding: 15px;
        border-radius: 6px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .prm-progress-indicator {
        display: none;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .affiliate-info-section {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .confirmation-item {
        flex-direction: column;
        margin-bottom: 15px;
    }
    
    .confirmation-item .label {
        min-width: auto;
        margin-bottom: 5px;
        font-weight: 600;
    }
    
    .file-upload-area {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .prm-form-container {
        margin: 5px;
        padding: 10px;
    }
    
    .prm-form-header h2 {
        font-size: 20px;
    }
    
    .form-step h3 {
        font-size: 18px;
    }
    
    .affiliate-info-section {
        padding: 15px 10px;
    }
}

/* Print styles */
@media print {
    .prm-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .form-actions {
        display: none;
    }
    
    .prm-progress-indicator {
        display: none;
    }
    
    .file-upload-area {
        border: 1px solid #ccc;
        background: white;
    }
}