/* Elderink Member Registration - Frontend Styles */

/* Main form containers */
.emr-registration-form,
.emr-member-profile,
.emr-family-manager {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.emr-registration-form h3,
.emr-member-profile h2,
.emr-family-manager h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Form layouts */
.emr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.emr-form-field {
    margin-bottom: 15px;
}

.emr-form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.emr-form-field input,
.emr-form-field select,
.emr-form-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.emr-form-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Profile header */
.emr-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.emr-profile-photo {
    position: relative;
    text-align: center;
}

.emr-profile-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0073aa;
}

.emr-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ddd;
}

.emr-photo-placeholder i {
    font-size: 40px;
    color: #666;
}

.emr-upload-photo-btn {
    display: block;
    margin-top: 10px;
    padding: 5px 10px;
    font-size: 12px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.emr-upload-photo-btn:hover {
    background: #005a87;
}

.emr-profile-info h2 {
    margin: 0;
    color: #333;
}

.emr-member-type {
    color: #666;
    font-style: italic;
    margin: 5px 0 0 0;
}

/* Form sections */
.emr-form-section {
    margin-bottom: 30px;
}

.emr-form-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

/* Buttons */
.emr-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.emr-btn-primary {
    background: #0073aa;
    color: white;
}

.emr-btn-primary:hover {
    background: #005a87;
    color: white;
}

.emr-btn-secondary {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.emr-btn-secondary:hover {
    background: #e5e5e5;
    color: #333;
}

.emr-btn-danger {
    background: #dc3232;
    color: white;
}

.emr-btn-danger:hover {
    background: #b32d2e;
    color: white;
}

.emr-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.emr-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Family members */
.emr-family-header {
    margin-bottom: 20px;
}

.emr-family-header p {
    color: #666;
    margin: 5px 0 0 0;
}

.emr-family-members-list {
    margin-bottom: 30px;
}

.emr-family-member-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.emr-member-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.emr-member-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.emr-member-actions {
    display: flex;
    gap: 8px;
}

.emr-add-member-section {
    text-align: center;
    margin: 20px 0;
}

.emr-member-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
}

.emr-member-form h4 {
    margin-top: 0;
    color: #333;
}

.emr-max-members-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    color: #856404;
}

/* Messages */
.emr-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: bold;
}

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

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

/* Loading states */
.emr-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.emr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: emr-spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .emr-registration-form,
    .emr-member-profile,
    .emr-family-manager {
        padding: 20px;
        margin: 10px 0;
    }
    
    .emr-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .emr-profile-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .emr-family-member-card {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .emr-member-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .emr-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .emr-form-actions {
        text-align: center;
    }
    
    .emr-member-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* Accessibility improvements */
.emr-form-field input:invalid {
    border-color: #dc3232;
}

.emr-form-field input:valid {
    border-color: #46b450;
}

.emr-form-field .required::after {
    content: ' *';
    color: #dc3232;
}

/* Print styles for member cards */
@media print {
    .emr-member-actions,
    .emr-upload-photo-btn,
    .emr-add-member-section {
        display: none;
    }
    
    .emr-family-member-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}