/* components.css - Shared component styles */

/* Section headers (profile, intake forms) */
.intake-section {
    margin-bottom: var(--hc-space-8);
}

.intake-section h4 {
    border-bottom: 2px solid var(--hc-gray-200);
    padding-bottom: var(--hc-space-2);
    margin-bottom: var(--hc-space-4);
}

/* Unified data table (replaces .profile-table, .check-in-table, .queue-table, inline table styles) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--hc-space-4);
}

.data-table th {
    text-align: left;
    padding: var(--hc-space-2);
    border-bottom: 2px solid var(--hc-gray-200);
    text-transform: uppercase;
    letter-spacing: var(--hc-tracking-wide);
    font-weight: var(--hc-font-medium);
    font-size: var(--hc-text-sm);
    color: var(--hc-gray-600);
}

.data-table td {
    padding: var(--hc-space-2);
    border-bottom: 1px solid var(--hc-gray-100);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .data-label {
    font-weight: var(--hc-font-medium);
    color: var(--hc-gray-600);
    width: 160px;
}

/* Status badges (practitioner dashboard, patient queue) */
.status-badge {
    padding: 3px var(--hc-space-3);
    border-radius: var(--hc-radius-full);
    font-size: var(--hc-text-sm);
}

.status-badge--waiting {
    background-color: var(--hc-status-waiting-bg);
    color: var(--hc-status-waiting-text);
}

.status-badge--called {
    background-color: var(--hc-status-called-bg);
    color: var(--hc-status-called-text);
}

.status-badge--in-progress {
    background-color: var(--hc-status-in-progress-bg);
    color: var(--hc-status-in-progress-text);
}

/* Status boxes (patient queue status page) */
.status-box {
    padding: var(--hc-space-8);
    border-radius: var(--hc-radius-lg);
    margin: var(--hc-space-5) 0;
}

.status-box--waiting {
    background-color: var(--hc-status-waiting-bg);
}

.status-box--called {
    background-color: var(--hc-status-called-bg);
}

.status-box--in-progress {
    background-color: var(--hc-status-in-progress-bg);
}

.status-box h3 {
    margin: 0;
}

.status-box--called h3 {
    color: var(--hc-status-called-text);
    font-size: var(--hc-text-2xl);
}

.status-box--in-progress h3 {
    color: var(--hc-status-in-progress-text);
}

/* Card section (replaces .contact-entry, .consent-item, .communication-item, .address-lookup-card) */
.card-section {
    border: 1px solid var(--hc-gray-200);
    border-radius: var(--hc-radius-md);
    padding: var(--hc-space-4);
    margin-bottom: var(--hc-space-4);
}

.card-section--muted {
    background-color: var(--hc-gray-50);
}

.card-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hc-space-4);
    padding-bottom: var(--hc-space-2);
    border-bottom: 1px solid var(--hc-gray-200);
}

.card-section-header .icon {
    font-size: var(--hc-text-xl);
}

.card-section .helper-text {
    font-size: var(--hc-text-sm);
    color: var(--hc-gray-600);
    margin-bottom: var(--hc-space-4);
}

.card-section .consent-description {
    font-size: 0.9rem;
    color: var(--hc-gray-600);
    margin-bottom: var(--hc-space-2);
}

/* Communication items (intake form checkboxes) */
.communication-item {
    padding: var(--hc-space-3) var(--hc-space-4);
    border: 1px solid var(--hc-gray-200);
    border-radius: var(--hc-radius-md);
    margin-bottom: var(--hc-space-2);
}

/* Signature section (intake form) */
.signature-section {
    border-top: 2px solid var(--hc-gray-700);
    padding-top: var(--hc-space-6);
    margin-top: var(--hc-space-8);
}

/* Auth card (login, signup, logout, email confirm, verification sent) */
.auth-card {
    max-width: var(--hc-auth-card-width);
    margin: var(--hc-space-12) auto;
}

.auth-card--narrow {
    max-width: var(--hc-auth-card-narrow);
    margin: var(--hc-space-12) auto;
}

/* The card heading is the page's single h1; size it like the old h2 so the
 * visual hierarchy is unchanged while satisfying one-h1-per-page (WCAG 1.3.1). */
.auth-card h1,
.auth-card--narrow h1 {
    font-size: var(--hc-text-3xl);
}

/* Auth footer (links below auth forms) */
.auth-footer {
    text-align: center;
    margin-top: var(--hc-space-8);
    padding-top: var(--hc-space-5);
    border-top: 1px solid var(--hc-gray-100);
}

/* Field error messages */
.field-error {
    color: var(--hc-error-500);
    font-size: var(--hc-text-sm);
    margin-top: var(--hc-space-1);
}

/* Full-width button */
.btn--full {
    width: 100%;
    padding: var(--hc-space-4);
    font-size: var(--hc-text-base);
}

/* Back link */
.back-link {
    margin-top: var(--hc-space-4);
    text-align: center;
}

/* Empty state message */
.empty-message {
    text-align: center;
    color: var(--hc-gray-400);
    margin-top: var(--hc-space-8);
}

/* Inline form (side-by-side action buttons) */
.inline-form {
    display: inline;
}

/* Action button (compact button for table rows) */
.action-btn {
    padding: var(--hc-space-1) var(--hc-space-3);
    font-size: var(--hc-text-sm);
}

/* Info note box */
.info-note {
    background: var(--hc-gray-50);
    padding: var(--hc-space-4);
    border-radius: var(--hc-radius-md);
    margin-bottom: var(--hc-space-5);
    font-size: var(--hc-text-sm);
    color: var(--hc-gray-600);
}

/* Alert banners (home page warnings) */
.alert-banner {
    margin: 0;
    padding: var(--hc-space-5);
    color: var(--hc-gray-700);
    grid-column: 1 / -1;
}

.alert-banner--warning {
    background-color: var(--hc-alert-warning-bg);
    border-left: 4px solid var(--hc-alert-warning-border);
}

.alert-banner--caution {
    background-color: var(--hc-alert-caution-bg);
    border-left: 4px solid var(--hc-alert-caution-border);
}

.alert-banner--info {
    background-color: var(--hc-alert-info-bg);
    border-left: 4px solid var(--hc-alert-info-border);
}

/* Session outcome reconciliation list (practitioner home) */
.outcome-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.outcome-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hc-space-3);
    flex-wrap: wrap;
    padding: var(--hc-space-3) 0;
    border-bottom: 1px solid var(--hc-gray-100);
}

.outcome-list__item:last-child {
    border-bottom: none;
}

.outcome-list__who {
    color: var(--hc-gray-700);
}

.outcome-list__actions {
    display: flex;
    gap: var(--hc-space-2);
}

.outcome-list__more {
    margin: var(--hc-space-2) 0 0;
    color: var(--hc-gray-600);
    font-size: var(--hc-text-sm);
}

/* Home page grid layout */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--hc-space-5);
    margin-top: var(--hc-space-5);
}

/* Grid card (card inside grid - no margin, flex column) */
.grid-card {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.grid-card--full {
    grid-column: 1 / -1;
}

/* Landing page styles */
.landing-subtitle {
    font-size: var(--hc-text-xl);
    margin: var(--hc-space-5) 0;
    color: var(--hc-gray-600);
}

.landing-features {
    max-width: var(--hc-landing-features);
    margin: var(--hc-space-8) auto;
    text-align: left;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: var(--hc-space-3) 0;
    border-bottom: 1px solid var(--hc-gray-100);
}

.landing-cta {
    margin-top: var(--hc-space-10);
}

.btn--lg {
    font-size: 1.1rem;
    padding: var(--hc-space-4) var(--hc-space-8);
}

/* Check-in card */
.check-in-card {
    max-width: var(--hc-check-in-card-width);
    margin: 0 auto;
}

/* Verification success box */
.verification-box {
    background: var(--hc-verification-bg);
    padding: var(--hc-space-5);
    border-radius: var(--hc-radius-md);
    margin-bottom: var(--hc-space-8);
    color: var(--hc-verification-text);
}

/* Verification heading color */
.text-success-dark {
    color: var(--hc-verification-heading);
}

/* Spaced list (for ordered step lists) */
.list-spaced {
    line-height: 1.8;
}

/* Profile data table width constraint */
.data-table--narrow {
    max-width: var(--hc-data-table-narrow);
}

/* Status detail text (queue status page) */
.status-detail {
    font-size: var(--hc-text-xl);
    margin-top: var(--hc-space-3);
}

.status-hint {
    color: var(--hc-gray-600);
}

.check-in-time {
    color: var(--hc-gray-400);
    margin-top: var(--hc-space-5);
}

/* Remember me checkbox override */
.form-group .remember-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-group .remember-label input[type="checkbox"] {
    width: auto;
    margin-right: var(--hc-space-3);
}

/* Onboarding step indicator */
.onboarding-steps {
    padding: 0;
}

.onboarding-steps .d-flex {
    gap: 0;
}

.onboarding-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    gap: var(--hc-space-1);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: var(--hc-radius-full);
    border: 2px solid var(--hc-gray-300);
    color: var(--hc-gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--hc-text-sm);
    font-weight: var(--hc-font-semibold);
    flex-shrink: 0;
    transition: all var(--hc-transition-fast);
}

.step-label {
    font-size: 0.75rem;
    color: var(--hc-gray-400);
    text-align: center;
    transition: color var(--hc-transition-fast);
}

.step-connector {
    flex: 1 1 0;
    min-width: 16px;
    height: 2px;
    background-color: var(--hc-gray-200);
    align-self: center;
    margin: 0 var(--hc-space-1);
    margin-bottom: 18px;
}

.onboarding-step.active .step-number {
    border-color: var(--hc-primary-600);
    background-color: var(--hc-primary-600);
    color: var(--hc-white);
}

.onboarding-step.active .step-label {
    color: var(--hc-primary-700);
    font-weight: var(--hc-font-medium);
}

.onboarding-step.completed .step-number {
    border-color: var(--hc-success-500);
    background-color: var(--hc-success-500);
    color: var(--hc-white);
}

.onboarding-step.completed .step-label {
    color: var(--hc-success-700);
}

/* Stripe card element containers */
.stripe-card-element {
    padding: var(--hc-space-4);
    border: 1px solid var(--hc-gray-200);
    border-radius: var(--hc-radius-md);
    background: var(--hc-white);
}

/* Hide Stripe Link autofill button */
.stripe-card-element iframe[name*="Button"] {
    visibility: hidden !important;
}


.stripe-row {
    display: flex;
    gap: var(--hc-space-4);
}

.stripe-col {
    flex: 1;
}

/* Rebook page */
.rebook-page {
    display: flex;
    justify-content: center;
}

.rebook-card {
    width: 100%;
    max-width: var(--hc-rebook-card-width);
}

.rebook-card__lead {
    color: var(--hc-gray-600);
    font-size: var(--hc-text-lg);
    margin-bottom: var(--hc-space-6);
}

.rebook-preferred {
    margin-bottom: var(--hc-space-6);
}

.rebook-preferred p {
    color: var(--hc-gray-700);
    font-weight: var(--hc-font-medium);
    margin-bottom: var(--hc-space-3);
}

.rebook-group {
    margin-top: var(--hc-space-8);
}

.rebook-group h2 {
    font-size: var(--hc-text-lg);
    margin-bottom: var(--hc-space-4);
}

.rebook-choices {
    display: flex;
    flex-direction: column;
    gap: var(--hc-space-2);
}

.rebook-choice {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--hc-space-4);
    width: 100%;
    text-align: left;
}

.rebook-card .alert-banner {
    border-radius: var(--hc-radius-md);
    margin-bottom: var(--hc-space-6);
}

.rebook-choice__label {
    font-weight: var(--hc-font-semibold);
}

.rebook-choice__when {
    font-size: var(--hc-text-sm);
}

/* Mute the timestamp only on light (secondary) choices. On the dark primary
 * "usual slot" button the inherited white must stay full-opacity to clear AA. */
.btn-secondary .rebook-choice__when {
    color: var(--hc-gray-600);
}

/* Booking confirmation modal */
.rebook-dialog {
    border: none;
    border-radius: var(--hc-radius-lg);
    padding: var(--hc-space-8);
    width: calc(100% - var(--hc-space-8));
    max-width: var(--hc-rebook-dialog-width);
    color: var(--hc-gray-700);
    box-shadow: var(--hc-shadow-lg);
    /* The global `* { margin: 0 }` reset kills the UA's auto-centering for a
     * modal dialog; restore it so showModal() opens centred in the viewport. */
    margin: auto;
}

.rebook-dialog::backdrop {
    background-color: var(--hc-scrim);
}

.rebook-dialog__title {
    font-size: var(--hc-text-xl);
    margin-bottom: var(--hc-space-3);
}

.rebook-dialog__summary {
    font-size: var(--hc-text-lg);
    color: var(--hc-gray-600);
    margin-bottom: var(--hc-space-6);
}

.rebook-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--hc-space-3);
}

.confirm-dialog {
    border: none;
    border-radius: var(--hc-radius-lg);
    padding: var(--hc-space-8);
    width: calc(100% - var(--hc-space-8));
    max-width: var(--hc-dialog-width);
    color: var(--hc-gray-700);
    box-shadow: var(--hc-shadow-lg);
    margin: auto;
}

.confirm-dialog::backdrop {
    background-color: var(--hc-scrim);
}

.confirm-dialog h3 {
    font-size: var(--hc-text-xl);
    margin-bottom: var(--hc-space-3);
}

.confirm-dialog p {
    font-size: var(--hc-text-lg);
    color: var(--hc-gray-600);
    margin-bottom: var(--hc-space-6);
}

.confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--hc-space-3);
}

.rebook-card__more {
    margin-top: var(--hc-space-8);
}

.rebook-prompt {
    background-color: var(--hc-primary-50);
    border: 1px solid var(--hc-primary-100);
}

/* Meeting modes panel (practitioner profile: sets in-person/online days) */
.meeting-modes-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--hc-space-6);
}

.meeting-modes-table th,
.meeting-modes-table td {
    padding: var(--hc-space-3) var(--hc-space-4);
    border-bottom: 1px solid var(--hc-gray-200);
    text-align: left;
    vertical-align: middle;
}

.meeting-modes-table thead th {
    color: var(--hc-gray-600);
    font-weight: var(--hc-font-semibold);
}

/* Payment issues (issue #94): home banner + issues list */
.payment-issues-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hc-space-3);
    flex-wrap: wrap;
    border-left: 4px solid var(--hc-warning-500);
}

.payment-issues-banner__text {
    color: var(--hc-gray-700);
    font-weight: var(--hc-font-semibold);
}

.payment-issues-page {
    max-width: 60rem;
    margin: 0 auto;
    padding: var(--hc-space-6) var(--hc-space-4);
}

.payment-issues-card__lead {
    color: var(--hc-gray-600);
}

.payment-issues-card__empty {
    color: var(--hc-gray-600);
    margin: var(--hc-space-4) 0 0;
}

.payment-issues-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.payment-issues-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hc-space-3);
    flex-wrap: wrap;
    padding: var(--hc-space-3) 0;
    border-bottom: 1px solid var(--hc-gray-100);
}

.payment-issues-list__item:last-child {
    border-bottom: none;
}

.payment-issues-list__what {
    color: var(--hc-gray-700);
}

.payment-issues-list__amount {
    font-weight: var(--hc-font-semibold);
    margin-left: var(--hc-space-2);
}

.payment-issues-list__type {
    color: var(--hc-gray-600);
    font-size: var(--hc-text-sm);
    margin-left: var(--hc-space-2);
}

.payment-issues-list__status {
    display: flex;
    align-items: center;
    gap: var(--hc-space-2);
    flex-wrap: wrap;
}

.payment-issues-list__hint {
    color: var(--hc-gray-600);
    font-size: var(--hc-text-sm);
}

.payment-default-badge {
    margin-left: var(--hc-space-2);
    vertical-align: middle;
}

.payment-issues-card__backlog {
    color: var(--hc-gray-600);
    font-size: var(--hc-text-sm);
    margin: var(--hc-space-3) 0 0;
}

.billing-card__contact {
    margin: var(--hc-space-3) 0 var(--hc-space-5);
    padding: var(--hc-space-3) var(--hc-space-4);
    background: var(--hc-gray-50);
    border-radius: var(--hc-radius-md);
}

.billing-card__row {
    display: flex;
    gap: var(--hc-space-3);
    padding: var(--hc-space-1) 0;
}

.billing-card__row dt {
    flex: 0 0 8rem;
    color: var(--hc-gray-600);
    font-weight: var(--hc-font-semibold);
}

.billing-card__row dd {
    margin: 0;
    color: var(--hc-gray-700);
}
