/* broker-portal.css */
#broker-portal-container,
#client-portal-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.broker-section {
    background: white;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.broker-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn:hover {
    background: #005a87;
}

.btn-primary {
    background: #007cba;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.loading {
    color: #007cba;
    font-style: italic;
    padding: 10px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
}

.success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.result-section {
    margin-top: 20px;
}

.client-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
}

.client-success h4 {
    color: #155724;
    margin-top: 0;
}

.client-details {
    margin: 15px 0;
}

.client-details p {
    margin: 8px 0;
}

.client-details strong {
    color: #333;
}

.client-details code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: #e83e8c;
}

.portal-link {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

.portal-link input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    font-size: 12px;
}

.instructions {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 13px;
}

.instructions p {
    margin: 0;
    color: #856404;
}

#logout-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
}

/* Client Portal Styles */
#client-portal-container {
    max-width: 600px;
}

.client-welcome {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.client-welcome h4 {
    color: #1976d2;
    margin-top: 0;
}

.client-welcome p {
    margin: 10px 0;
    color: #333;
}

#client-form-section {
    background: white;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#client-form-section h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #28a745;
    padding-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #broker-portal-container,
    #client-portal-container {
        margin: 10px;
        padding: 15px;
    }
    
    .broker-section {
        padding: 20px;
    }
    
    .portal-link {
        flex-direction: column;
        align-items: stretch;
    }
    
    .portal-link input {
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Loading spinner */
.loading:before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid #007cba;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form validation styles */
.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

/* Accessibility improvements */
.btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid #007cba;
    outline-offset: 1px;
}

/* Print styles */
@media print {
    .btn,
    #logout-section {
        display: none;
    }
    
    .client-success {
        break-inside: avoid;
    }
}