/**
 * Agent Registration Styles
 */

/* Form Wrapper */
.inpost-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.inpost-form {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inpost-form h2 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

/* Fieldsets */
.inpost-form fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    background: #f9f9f9;
}

.inpost-form legend {
    font-weight: 600;
    color: #333;
    padding: 0 10px;
    background: white;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

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

/* Required Fields */
.required {
    color: #dc3232;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    width: auto;
}

/* Field Messages */
.field-message {
    display: block;
    margin-top: 5px;
    font-size: 14px;
}

.field-message.success {
    color: #46b450;
}

.field-message.error {
    color: #dc3232;
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #999;
}

/* Checkbox Styling */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.form-actions .button {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.form-actions .button-primary {
    background: #0073aa;
    color: white;
}

.form-actions .button-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-actions .button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.form-actions .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.form-actions .spinner.is-active {
    display: inline-block;
}

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

/* Form Messages */
.form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.form-messages.success {
    background: #e6f7e6;
    border: 1px solid #46b450;
    color: #2e7d32;
    display: block;
}

.form-messages.error {
    background: #ffebee;
    border: 1px solid #dc3232;
    color: #c62828;
    display: block;
}

/* Company Dashboard Styles */
.company-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.dashboard-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.dashboard-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Sub-agents Table */
#sub-agents-list table {
    margin-top: 20px;
}

#sub-agents-list .button {
    margin-right: 5px;
}

/* Login Form Styles */
.inpost-login-form {
    max-width: 400px;
    margin: 0 auto;
}

.inpost-login-form .form-group {
    margin-bottom: 15px;
}

.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-links a {
    color: #0073aa;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .inpost-form-wrapper {
        padding: 10px;
    }
    
    .inpost-form {
        padding: 20px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .company-dashboard {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .button {
        width: 100%;
    }
}

/* Modal Styles for Sub-agent Management */
.inpost-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.inpost-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* Pending Approvals */
.approval-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.approval-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.approval-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.approval-actions {
    display: flex;
    gap: 10px;
}

.approval-actions .button-approve {
    background: #46b450;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.approval-actions .button-reject {
    background: #dc3232;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e6f7e6;
    color: #2e7d32;
}

.status-badge.inactive {
    background: #ffebee;
    color: #c62828;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}
