/* Modal Appointment Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.modal-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.modal-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #93c5fd;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--accent);
}

.modal-close svg {
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.modal-body {
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.section-title svg {
    width: 1rem;
    height: 1rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .form-row.two-columns {
        grid-template-columns: 1fr 1fr;
    }
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.has-icon {
    padding-left: 2.5rem;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.character-count {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-align: right;
    margin-top: 0.25rem;
}

/* CAPTCHA Styles */
.captcha-container {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem;
}

.captcha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.captcha-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e40af;
    margin: 0;
}

.captcha-refresh {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #2563eb;
    transition: all 0.2s;
}

.captcha-refresh:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.captcha-refresh svg {
    width: 1rem;
    height: 1rem;
}

.captcha-instruction {
    font-size: 0.75rem;
    color: #1d4ed8;
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.captcha-question-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.captcha-question-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 2px solid #93c5fd;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    min-width: 120px;
}

.captcha-question-text {
    font-size: 1.25rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #1e40af;
}

.captcha-answer-container {
    flex: 1;
    max-width: 100px;
}

.captcha-answer-input {
    text-align: center;
    font-size: 1.125rem;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.captcha-answer-input.captcha-correct {
    border-color: #10b981;
    background-color: #ecfdf5;
}

.captcha-answer-input.captcha-incorrect {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.captcha-feedback {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.captcha-feedback-success {
    color: #059669;
}

.captcha-feedback-error {
    color: #dc2626;
}

.captcha-feedback svg {
    width: 1rem;
    height: 1rem;
}

.captcha-note {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 1rem;
    margin-bottom: 0;
}

.captcha-note strong {
    color: var(--foreground);
}

.info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-box-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.info-box-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #2563eb;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.info-box-text {
    font-size: 0.875rem;
}

.info-box-title {
    font-weight: 500;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.info-box-list {
    color: #1d4ed8;
    margin: 0;
    padding: 0;
    list-style: none;
}

.info-box-list li {
    margin-bottom: 0.25rem;
}

.error-box {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.error-box-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-box-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
}

.error-box-text {
    font-size: 0.875rem;
    color: #b91c1c;
}

.success-state {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    background-color: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.success-icon svg {
    width: 2rem;
    height: 2rem;
    color: #16a34a;
}

.success-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #166534;
    margin-bottom: 0.5rem;
}

.success-text {
    color: #16a34a;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
}

@media (min-width: 640px) {
    .form-actions {
        flex-direction: row;
    }
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    flex: 1;
    min-height: 2.75rem;
}

.btn-modal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary-modal {
    background-color: var(--primary);
    color: white;
}

.btn-primary-modal:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-outline-modal {
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--foreground);
}

.btn-outline-modal:hover {
    background-color: var(--accent);
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 640px) {
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
    
    .form-row.two-columns {
        grid-template-columns: 1fr;
    }
    
    .captcha-question-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .captcha-answer-container {
        max-width: none;
    }
}