/* Patient Form System - Styles */

.patient-form-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.patient-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e5e9;
}

.patient-form-header h2 {
    color: #2c5aa0;
    margin-bottom: 10px;
    font-size: 2.2rem;
}

.patient-form-header p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.patient-form {
    margin-bottom: 30px;
}

.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #2c5aa0;
}

.form-section h3 {
    color: #2c5aa0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-group input[readonly] {
    background: #f8f9fa;
    color: #666;
    cursor: not-allowed;
}

.phone-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.phone-group {
    display: flex;
    flex-direction: column;
}

.phone-group label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.doctors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.doctor-card {
    background: white;
    border: 3px solid #e1e5e9;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.doctor-card:hover {
    border-color: #2c5aa0;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 90, 160, 0.15);
}

.doctor-card.selected {
    border-color: #2c5aa0;
    background: linear-gradient(135deg, #e6f3ff 0%, #f0f8ff 100%);
    box-shadow: 0 8px 25px rgba(44, 90, 160, 0.2);
}

.doctor-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.doctor-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 10px;
}

.doctor-title {
    color: #666;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.doctor-info {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 15px;
}

.doctor-info div {
    margin-bottom: 8px;
}

.doctor-info strong {
    color: #2c5aa0;
    font-weight: 600;
}

.doctor-description {
    font-size: 13px;
    color: #777;
    font-style: italic;
    text-align: left;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.doctor-slots {
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 600;
    margin-top: 10px;
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    font-weight: 600;
    text-align: center;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e1e5e9;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    color: #2c5aa0;
}

.btn-primary:hover {
    background: #2c5aa0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success Page Styles */
.patient-form-success {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.success-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    border: 1px solid #c3e6cb;
}

.success-header h2 {
    color: #155724;
    margin-bottom: 10px;
}

.success-content {
    margin-bottom: 30px;
}

.patient-summary,
.doctor-summary,
.submission-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2c5aa0;
}

.patient-summary h3,
.doctor-summary h3,
.submission-info h3 {
    color: #2c5aa0;
    margin-bottom: 15px;
}

.summary-grid,
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.summary-item,
.info-item {
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e1e5e9;
}

.summary-item strong,
.info-item strong {
    color: #2c5aa0;
}

.doctor-card-success {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #2c5aa0;
    text-align: center;
}

.doctor-card-success .doctor-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 10px;
}

.doctor-card-success .doctor-title {
    color: #666;
    margin-bottom: 15px;
}

.doctor-details {
    text-align: left;
}

.doctor-details div {
    margin-bottom: 8px;
}

.status-submitted {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.success-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e1e5e9;
}

.success-actions .btn {
    margin: 0 10px;
}

/* Status Page Styles */
.patient-form-status {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.patient-form-status h2 {
    text-align: center;
    color: #2c5aa0;
    margin-bottom: 30px;
}

.status-submitted,
.status-not-submitted {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #2c5aa0;
}

.status-submitted {
    border-left-color: #28a745;
}

.status-not-submitted {
    border-left-color: #dc3545;
}

.status-submitted h3,
.status-not-submitted h3 {
    margin-bottom: 15px;
}

.status-actions {
    margin-top: 20px;
}

/* Error Messages */
.patient-form-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

.patient-form-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #bee5eb;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Validation */
.form-group.error input,
.form-group.error select {
    border-color: #dc3545;
}

.form-group.error .error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.form-group.success input,
.form-group.success select {
    border-color: #28a745;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .phone-inputs {
        grid-template-columns: 1fr;
    }
    
    .doctors-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .patient-form-container,
    .patient-form-success,
    .patient-form-status {
        margin: 10px;
        padding: 15px;
    }
    
    .success-actions .btn {
        display: block;
        margin: 10px 0;
    }
}

/* Family Members Section */
.section-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-style: italic;
}

#family-members-container {
    margin-bottom: 20px;
}

.family-member-card {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.family-member-card:hover {
    border-color: #2c5aa0;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
}

.family-member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5e9;
}

.family-member-title {
    font-weight: 600;
    color: #2c5aa0;
    font-size: 1.1rem;
}

.remove-member-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-member-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.family-member-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.family-member-fields .form-group {
    margin-bottom: 0;
}

.add-family-member {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.btn-add-member {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-member:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-add-member:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.member-count {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.member-count span {
    color: #2c5aa0;
    font-weight: 600;
}

.submit-info {
    margin-top: 15px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid #2c5aa0;
}

.submit-info p {
    margin: 0;
    color: #2c5aa0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-info i {
    font-size: 1rem;
}

/* Responsive for family members */
@media (max-width: 768px) {
    .family-member-fields {
        grid-template-columns: 1fr;
    }
    
    .add-family-member {
        flex-direction: column;
        text-align: center;
    }
    
    .family-member-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.family-member-card {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Stiluri pentru autofill CNP */
.auto-filled {
    background-color: #e8f5e8 !important;
    border-color: #4caf50 !important;
    position: relative;
}

.auto-filled::after {
    content: "✓";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #4caf50;
    font-weight: bold;
    font-size: 16px;
}

.loading {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
    position: relative;
}

.loading::after {
    content: "⏳";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffc107;
    font-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.edit-manual-btn-container {
    margin-top: 15px;
    text-align: center;
}

.edit-manual-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.edit-manual-btn:hover {
    background: #f57c00;
}

.edit-manual-btn i {
    margin-right: 5px;
}

/* Modal de Confirmare */
.confirmation-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.confirmation-modal.show {
    display: block !important;
}

.confirmation-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.confirmation-modal .modal-content {
    position: relative;
    max-width: 600px;
    margin: 5% auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirmation-modal .modal-header {
    background: linear-gradient(135deg, #2c5aa0, #1e3d72);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.confirmation-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.confirmation-modal .modal-header h2 i {
    margin-right: 10px;
    color: #4fc3f7;
}

.confirmation-modal .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.confirmation-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.confirmation-modal .modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.confirmation-summary h3 {
    color: #2c5aa0;
    font-size: 1.2rem;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5e9;
    display: flex;
    align-items: center;
}

.confirmation-summary h3 i {
    margin-right: 10px;
    color: #4fc3f7;
}

.confirmation-summary h3:first-child {
    margin-top: 0;
}

.summary-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #2c5aa0;
}

.summary-section p {
    margin: 8px 0;
    color: #333;
    line-height: 1.5;
}

.summary-section p strong {
    color: #2c5aa0;
    font-weight: 600;
}

.doctor-summary {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-left-color: #7b1fa2;
}

.doctor-card-summary {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.doctor-card-summary h4 {
    color: #2c5aa0;
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.doctor-card-summary p {
    margin: 5px 0;
    color: #555;
}

.family-member-summary {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #4fc3f7;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.family-member-summary p {
    margin: 5px 0;
}

.family-member-summary p:first-child {
    font-weight: 600;
    color: #2c5aa0;
}

.confirmation-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.confirmation-warning p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

.confirmation-warning i {
    color: #f39c12;
    margin-right: 8px;
}

.confirmation-modal .modal-footer {
    background: #f8f9fa;
    padding: 20px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #e1e5e9;
}

.confirmation-modal .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirmation-modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.confirmation-modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.confirmation-modal .btn-primary {
    background: linear-gradient(135deg, #2c5aa0, #1e3d72);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.confirmation-modal .btn-primary:hover {
    background: linear-gradient(135deg, #1e3d72, #0f1f3d);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(44, 90, 160, 0.4);
}

.confirmation-modal .btn-primary:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .confirmation-modal .modal-content {
        margin: 10% 5%;
        max-width: none;
    }
    
    .confirmation-modal .modal-header,
    .confirmation-modal .modal-body,
    .confirmation-modal .modal-footer {
        padding: 15px;
    }
    
    .confirmation-modal .modal-footer {
        flex-direction: column;
    }
    
    .confirmation-modal .btn {
        width: 100%;
        justify-content: center;
    }
}