/* Full-screen overlay while validating / creating Stripe checkout (register.js) */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-sizing: border-box;
}

.loading-overlay p {
    margin: 0;
    max-width: 22rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: #0C3287;
    line-height: 1.45;
}

/* Loading Spinner Styles */
.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 5px solid transparent;
    border-top-color: var(--primary-color, #667eea);
    border-right-color: var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 2rem auto;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid transparent;
    border-top-color: var(--primary-color, #667eea);
    border-right-color: var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.payment-loading {
    text-align: center;
    padding: 3rem;
}

.payment-loading p {
    color: #6b7280;
    margin-top: 1rem;
}

.payment-result {
    text-align: center;
    padding: 2rem;
}

.payment-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.payment-error-message {
    color: var(--error-color, #dc3545);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-error-message a {
    color: var(--primary-color);
    text-decoration: underline;
}

.form-group input.error {
    border-color: var(--error-color, #dc3545);
}

/* Registration Flow Styles */

.registration-flow {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(135deg, #eef3fa 0%, #dde6f2 100%);
    padding: 70px clamp(16px, 4vw, 40px) 16px;
    overflow: visible;
}

.registration-flow .progress-container {
    flex-shrink: 0;
    margin-bottom: 12px;
    align-self: stretch;
}

.registration-flow .step-content {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    overflow: visible;
    align-self: stretch;
}

.registration-flow .step-content.active {
    display: flex;
}

.registration-flow .step-content .step-header {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.registration-flow .step-content .step-actions {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 12px;
}

/* Step 1: no inner scroll; page scrolls */
#step1.step-content.active {
    overflow: visible;
}

#step1 .step-header h1 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: 0;
}

#step1 .step-header .reg-audience-switch {
    margin-top: 0.5rem;
}

#stepPatient .patient-reg-header .reg-audience-switch {
    margin-top: 0.35rem;
}

#step1 .service-selection {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: clamp(16px, 2.5vw, 32px);
    margin-bottom: 12px;
    align-items: stretch;
    justify-content: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

#step1 .service-card {
    flex: 1;
    min-width: 0;
    max-width: 420px;
    padding: clamp(20px, 3vw, 32px);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
}

#step1 .service-selection .service-card:only-child {
    max-width: 520px;
}

#step1 .service-icon {
    width: clamp(48px, 10vw, 64px);
    height: clamp(48px, 10vw, 64px);
    margin: 0 auto clamp(8px, 1.5vw, 16px);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

#step1 .service-card h3 {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    margin-bottom: clamp(4px, 1vw, 10px);
}

#step1 .service-description {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    margin-bottom: clamp(8px, 1.5vw, 16px);
    line-height: 1.4;
}

#step1 .service-features {
    flex: 1;
    margin-bottom: clamp(8px, 1.5vw, 16px);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(4px, 1vw, 8px) clamp(12px, 2vw, 20px);
    text-align: left;
    align-content: start;
}

#step1 .feature-item {
    padding: clamp(3px, 0.5vw, 6px) 0;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
}

#step1 .service-checkbox {
    padding: clamp(8px, 1.5vw, 12px);
    margin-top: auto;
}

#step1 .service-select-text {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.plan-degloss .feature-row {
    padding: clamp(4px, 1vw, 8px) 0;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

/* Progress Bar - full width, clean stepper UI */
.progress-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: white;
    padding: 16px clamp(12px, 3vw, 24px);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: visible;
    position: relative;
}

/* Thin top progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 20%;
}

/* Stepper: equal columns so connector math stays correct at any width */
.progress-steps {
    --step-ring: 40px;
    --step-ring-half: 20px;
    --connector-y: 20px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: flex-start;
    position: relative;
    width: 100%;
    gap: 0;
    padding: 0 2px;
    box-sizing: border-box;
    overflow: visible;
}

@media (max-width: 720px) {
    .progress-steps {
        --step-ring: 34px;
        --step-ring-half: 17px;
        --connector-y: 17px;
    }
}

@media (max-width: 480px) {
    .progress-steps {
        --step-ring: 30px;
        --step-ring-half: 15px;
        --connector-y: 15px;
    }
}

.step-indicator {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    overflow: visible;
    padding: 0 2px;
    box-sizing: border-box;
}

/*
  Connector from right edge of this circle to left edge of next circle.
  In a cell of width C: start at 50% + R, length C - 2R (R = ring/2 including border ~20px).
  step-number is 40px + 3px border each side → visual radius ~23px; use --step-ring-half for alignment.
*/
.step-indicator:not(:last-child)::before {
    content: '';
    position: absolute;
    top: var(--connector-y);
    left: calc(50% + var(--step-ring-half));
    width: calc(100% - var(--step-ring));
    max-width: calc(100% - var(--step-ring));
    height: 3px;
    border-radius: 2px;
    background: var(--gray-200);
    z-index: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.step-indicator:last-child::before {
    display: none;
}

/* Segment i→i+1 is “done” when step i is completed */
.step-indicator.completed::before {
    background: var(--primary-color, #0c3287);
}

/* Current step: outgoing segment (to next) still pending */
.step-indicator.active:not(.completed)::before {
    background: var(--gray-200);
}

.step-actions .btn-primary,
.step-actions .btn-large {
    min-width: 180px;
}

.step-number {
    width: var(--step-ring);
    height: var(--step-ring);
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: clamp(0.75rem, 2.8vw, 0.9rem);
    margin-bottom: 8px;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    border: 3px solid var(--gray-200);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.step-indicator.active .step-number {
    background: var(--primary-color, #0c3287);
    color: white;
    border-color: var(--primary-color, #0c3287);
    box-shadow: 0 0 0 4px rgba(12, 50, 135, 0.12);
}

.step-indicator.completed .step-number {
    background: var(--success-color, #059669);
    color: white;
    border-color: var(--success-color, #059669);
}

.step-indicator.completed .step-number::after {
    content: none;
    display: none;
}

.step-label {
    font-size: clamp(0.65rem, 2.2vw, 0.8rem);
    color: var(--gray-600);
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.step-indicator.active .step-label {
    color: var(--primary-color, #0c3287);
    font-weight: 700;
}

/* Friendly subtitle: room on wider screens; hidden on very narrow to avoid overlap */
.step-hint {
    display: none;
    font-size: 0.68rem;
    line-height: 1.2;
    color: #64748b;
    text-align: center;
    margin-top: 4px;
    max-width: 100%;
    padding: 0 2px;
    font-weight: 400;
}

@media (min-width: 640px) {
    .step-hint {
        display: block;
    }
}

@media (min-width: 900px) {
    .step-hint {
        font-size: 0.72rem;
    }
}

.step-indicator.active .step-hint {
    color: #475569;
    font-weight: 500;
}

/* Narrow screens: one line under the stepper so labels/hints do not crowd connectors */
.progress-mobile-caption {
    display: none;
    text-align: center;
    font-size: clamp(0.8rem, 3.2vw, 0.9rem);
    color: var(--gray-700, #374151);
    margin: 12px 6px 0;
    line-height: 1.4;
    font-weight: 500;
    max-width: 100%;
    padding: 0 4px;
}

@media (max-width: 639px) {
    .progress-mobile-caption {
        display: block;
    }

    /* Hints are already hidden below 640px; hide labels so the row is numbers + connectors only */
    .step-indicator .step-label {
        display: none;
    }

    .step-number {
        margin-bottom: 4px;
    }
}

/* Step Content - full width of flow area */
.step-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    background: white;
    padding: clamp(20px, 3vw, 40px);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: none;
    animation: fadeInSlide 0.4s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: 20px;
}

.step-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--gray-900);
    margin-bottom: 10px;
}

.step-header p {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
}

.reg-audience-switch {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
}

.reg-audience-switch a {
    color: var(--primary-color, #0C3287);
    font-weight: 600;
    text-decoration: none;
}

.reg-audience-switch a:hover {
    text-decoration: underline;
}

/* Service Selection */
.service-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.service-card {
    background: white;
    border: 3px solid var(--gray-200);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.service-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(12, 50, 135, 0.05) 0%, rgba(12, 50, 135, 0.02) 100%);
    box-shadow: 0 0 0 4px rgba(12, 50, 135, 0.1);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.service-card h3 {
    font-size: var(--font-size-2xl);
    color: var(--gray-900);
    margin-bottom: 15px;
}

.service-description {
    color: var(--gray-600);
    margin-bottom: 25px;
    line-height: 1.6;
}

.service-features {
    text-align: left;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--gray-700);
}

.feature-item i {
    color: var(--success-color);
    font-size: 1.1rem;
}

/* Hidden checkbox when only one service (e.g. Expediente) – no UI, just keeps form state */
.service-checkbox-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.service-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    padding: 15px;
    background: var(--gray-50);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.service-card.selected .service-checkbox {
    background: var(--primary-color);
    color: white;
}

.service-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark-large {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-400);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.service-card.selected .checkmark-large {
    background: white;
    border-color: white;
}

.service-card.selected .checkmark-large::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
}

.service-select-text {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--gray-700);
}

.service-card.selected .service-select-text {
    color: white;
}

/* Plan Selection (Step 2: Elige tus Planes) */
#step2 .step-header {
    text-align: center;
}

#step2 .step-header h1 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: 4px;
}

#step2 .step-header p {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.plan-section {
    width: 100%;
    margin-bottom: clamp(24px, 4vw, 50px);
}

.plan-section:last-of-type {
    margin-bottom: 0;
}

.section-title-plan {
    font-size: clamp(1rem, 2.5vw, var(--font-size-2xl));
    color: var(--gray-900);
    margin-bottom: clamp(16px, 3vw, 30px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-plan i {
    color: var(--primary-color);
    flex-shrink: 0;
}

.plans-grid-register {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: clamp(16px, 3vw, 30px);
    margin-bottom: clamp(20px, 4vw, 40px);
    width: 100%;
}

.plan-section .plans-grid-register:last-child {
    margin-bottom: 0;
}

.plan-card-register {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: clamp(12px, 2.5vw, 20px);
    padding: clamp(16px, 3vw, 30px);
    transition: all 0.3s ease;
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.plan-card-register:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.plan-card-register.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(12, 50, 135, 0.05) 0%, rgba(12, 50, 135, 0.02) 100%);
    box-shadow: 0 0 0 4px rgba(12, 50, 135, 0.1);
}

.plan-card-register.featured {
    border-color: var(--primary-color);
}

@media (min-width: 769px) {
    .plan-card-register.featured {
        transform: scale(1.03);
    }
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 5px clamp(12px, 2vw, 20px);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.plan-header-register {
    text-align: center;
    margin-bottom: clamp(16px, 2.5vw, 25px);
    padding-bottom: clamp(16px, 2.5vw, 25px);
    border-bottom: 2px solid var(--gray-100);
}

.plan-header-register h3 {
    font-size: clamp(1.1rem, 2.5vw, var(--font-size-2xl));
    color: var(--gray-900);
    margin-bottom: clamp(8px, 1.5vw, 15px);
}

.plan-price-register {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.plan-price-register .currency {
    font-size: clamp(1rem, 2vw, var(--font-size-xl));
    color: var(--gray-600);
}

.plan-price-register .amount {
    font-size: clamp(1.5rem, 4vw, var(--font-size-4xl));
    font-weight: 700;
    color: var(--primary-color);
}

.plan-price-register .period {
    font-size: clamp(0.875rem, 1.5vw, var(--font-size-lg));
    color: var(--gray-600);
}

.plan-features-register {
    margin-bottom: clamp(12px, 2vw, 20px);
    flex: 1;
    min-height: 0;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: clamp(8px, 1.5vw, 12px) 0;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
}

.feature-row:last-child {
    border-bottom: none;
}

.feature-row i {
    color: var(--primary-color);
    width: 20px;
    min-width: 20px;
    font-size: 1rem;
    flex-shrink: 0;
}

.feature-row span {
    min-width: 0;
    word-wrap: break-word;
}

.plan-upgrades {
    background: var(--gray-50);
    padding: clamp(10px, 2vw, 15px);
    border-radius: 12px;
    margin-bottom: clamp(12px, 2vw, 20px);
}

.plan-upgrades small {
    display: block;
    color: var(--gray-600);
    font-size: var(--font-size-xs);
    margin-bottom: 4px;
}

.plan-upgrades small:last-child {
    margin-bottom: 0;
}

.btn-select-plan {
    width: 100%;
    padding: clamp(12px, 2vw, 14px);
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-weight: 600;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.plan-card-register.selected .btn-select-plan {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-select-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Plan Overview */
.plan-overview {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
}

.plan-overview h3 {
    font-size: var(--font-size-lg);
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-overview-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--gray-200);
}

.plan-overview-item:last-child {
    margin-bottom: 0;
}

.plan-overview-service {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-100);
}

.plan-overview-service i {
    font-size: 2rem;
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 50, 135, 0.1);
    border-radius: 12px;
}

.plan-overview-service strong {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--gray-900);
    margin-bottom: 5px;
}

.plan-tier {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.plan-overview-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.plan-overview-details .detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

.plan-overview-details .detail-item i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Promo Code Section */
.promo-code-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 16px;
    padding: 25px;
    margin: 30px 0;
}

.promo-code-section h3 {
    font-size: var(--font-size-lg);
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.promo-code-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.promo-code-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: var(--font-size-base);
    text-transform: uppercase;
}

.promo-code-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 50, 135, 0.1);
}

.promo-code-message {
    padding: 12px;
    border-radius: 10px;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.promo-code-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.promo-code-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Total Amount Box */
.total-amount-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    color: white;
    text-align: center;
}

.total-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.discount-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-base);
    font-weight: 500;
}

.discount-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #a7f3d0;
}

.total-original {
    margin-top: 10px;
    opacity: 0.8;
}

.total-original small {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: line-through;
}

.total-amount-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.total-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--font-size-lg);
    font-weight: 500;
}

.total-label i {
    font-size: 1.5rem;
}

.total-value {
    font-size: var(--font-size-4xl);
    font-weight: 700;
}

.total-note {
    text-align: center;
    opacity: 0.9;
}

.total-note small {
    color: rgba(255, 255, 255, 0.9);
}

/* Subscription Options */
.subscription-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.subscription-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.subscription-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.subscription-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(12, 50, 135, 0.05) 0%, rgba(12, 50, 135, 0.02) 100%);
    box-shadow: 0 0 0 4px rgba(12, 50, 135, 0.1);
}

.subscription-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.subscription-header {
    margin-bottom: 20px;
}

.subscription-header h3 {
    font-size: var(--font-size-2xl);
    color: var(--gray-900);
    margin-bottom: 15px;
}

.discount-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-700);
}

.discount-badge.discount {
    background: var(--warning-color);
    color: white;
}

.discount-badge.best {
    background: var(--success-color);
    color: white;
}

.subscription-price {
    margin-bottom: 25px;
}

.price-label {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    margin-bottom: 8px;
}

.savings {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--success-color);
    font-weight: 600;
}

.subscription-features {
    text-align: left;
    margin-bottom: 30px;
}

.btn-select-subscription {
    width: 100%;
    padding: 14px;
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscription-card.selected .btn-select-subscription {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-select-subscription:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Registration Form */
.registration-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--gray-100);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: var(--font-size-xl);
    color: var(--gray-900);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection-prompt {
    font-size: 1.1rem;
    color: var(--primary-color, #0C3287);
    margin-bottom: 8px;
    font-weight: 500;
}

.subsection-hint {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 16px;
}

/* ---- Step 4: datos de cuenta (wizard + responsive) ---- */
#step4 .step-header p strong {
    color: var(--gray-900, #111827);
    font-weight: 700;
}

#step4 .step4-progress-ui {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    padding: clamp(14px, 3vw, 20px) clamp(12px, 3vw, 20px);
    background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 100%);
    border: 1px solid rgba(12, 50, 135, 0.12);
    border-radius: 14px;
    box-sizing: border-box;
    width: 100%;
}

#step4 .step4-progress-ui__bar {
    height: 6px;
    border-radius: 6px;
    background: var(--gray-200, #e5e7eb);
    overflow: hidden;
    margin-bottom: 10px;
}

#step4 .step4-progress-ui__fill {
    height: 100%;
    width: 0%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary-color, #0c3287), var(--primary-dark, #082766));
    transition: width 0.35s ease;
}

#step4 .step4-progress-ui__caption {
    margin: 0 0 12px;
    font-size: clamp(0.85rem, 2.8vw, 0.95rem);
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    line-height: 1.4;
    text-align: center;
}

#step4 .step4-progress-ui__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
}

#step4 .step4-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: clamp(0.68rem, 2.4vw, 0.78rem);
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    max-width: 100%;
    text-align: center;
    line-height: 1.25;
}

#step4 .step4-chip.is-done {
    color: var(--success-color, #059669);
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.06);
}

#step4 .step4-chip.is-current {
    color: white;
    background: var(--primary-color, #0c3287);
    border-color: var(--primary-color, #0c3287);
    box-shadow: 0 2px 8px rgba(12, 50, 135, 0.25);
}

#step4 .registration-form.step4-registration-form {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(0px, 2vw, 8px);
    box-sizing: border-box;
}

#step4 .form-section.step4-panel {
    margin-bottom: 0;
    padding: clamp(18px, 3vw, 28px) clamp(14px, 3vw, 24px);
    padding-bottom: clamp(22px, 3.5vw, 32px);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 14px;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-top: 0;
}

#step4 .step4-panel + .step4-panel {
    margin-top: 0;
}

#step4 .subsection-prompt {
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    margin-bottom: 6px;
}

#step4 .form-section-title {
    font-size: clamp(1.05rem, 3.2vw, 1.25rem);
    margin-bottom: 12px;
}

#step4 .step4-inline-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    font-size: var(--font-size-sm, 0.875rem);
    letter-spacing: 0.3px;
}

#step4 .step4-doctor-block {
    margin-bottom: var(--spacing-6, 1.25rem);
}

#step4 .step4-segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
    width: 100%;
    max-width: 420px;
}

#step4 .step4-segment {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 14px;
    min-height: 48px;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    background: var(--gray-50, #f9fafb);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

#step4 .step4-segment:hover {
    border-color: var(--gray-300, #d1d5db);
}

#step4 .step4-segment:has(input:checked) {
    border-color: var(--primary-color, #0c3287);
    background: rgba(12, 50, 135, 0.06);
    box-shadow: 0 0 0 1px var(--primary-color, #0c3287);
}

#step4 .step4-segment input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

#step4 .step4-segment:focus-within {
    outline: 2px solid var(--primary-color, #0c3287);
    outline-offset: 2px;
}

#step4 .step4-segment-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800, #1f2937);
    pointer-events: none;
}

#step4 .step4-segment:has(input:checked) .step4-segment-text {
    color: var(--primary-color, #0c3287);
}

#step4 .step4-choice-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

#step4 .step4-choice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 14px 16px;
    min-height: 48px;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

#step4 .step4-choice:hover {
    border-color: var(--gray-300, #d1d5db);
    background: var(--gray-50, #f9fafb);
}

#step4 .step4-choice:has(input:checked) {
    border-color: var(--primary-color, #0c3287);
    background: rgba(12, 50, 135, 0.04);
    box-shadow: 0 0 0 1px rgba(12, 50, 135, 0.2);
}

#step4 .step4-choice input[type="radio"] {
    margin-top: 4px;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color, #0c3287);
}

#step4 .step4-choice-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#step4 .step4-choice-title {
    display: block;
    font-size: 0.95rem;
    color: var(--gray-900, #111827);
}

#step4 .step4-choice-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--gray-600, #4b5563);
    line-height: 1.45;
}

#step4 .step4-second-clinic-fields {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--gray-200, #e5e7eb);
}

#step4 #step4Actions.step4-actions {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: clamp(24px, 4vw, 40px);
    padding-top: clamp(18px, 3vw, 28px);
    align-items: stretch;
}

#step4 #step4Actions .btn {
    flex: 1 1 auto;
    min-width: min(140px, 42vw);
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#step4 #step4Actions .btn-secondary {
    flex: 0 1 auto;
}

@media (max-width: 520px) {
    #step4 .step4-segmented {
        grid-template-columns: 1fr;
        max-width: none;
    }

    #step4 .step4-chip {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    #step4 #step4Actions .btn-large {
        order: -1;
        flex: 1 1 100%;
    }

    #step4 #step4Actions .btn-secondary {
        flex: 1 1 calc(50% - 6px);
    }
}

@media (max-width: 768px) {
    #step4 .step4-progress-ui {
        margin-bottom: 1.25rem;
    }

    #step4 .registration-form .checkbox-group {
        padding: var(--spacing-3, 12px);
    }
}

@media (max-width: 380px) {
    #step4 .step4-chip {
        flex: 1 1 100%;
    }
}

/* Specialty combobox (searchable list + custom text; no user writes to catalog) */
#step4 .specialty-combobox-instance {
    margin-top: 4px;
}

#step4 .specialty-combobox__control {
    position: relative;
}

#step4 .specialty-combobox__search {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    font-size: var(--font-size-base, 1rem);
    font-family: inherit;
    background: white;
    color: var(--gray-900, #111827);
    box-sizing: border-box;
}

#step4 .specialty-combobox__search:focus {
    outline: none;
    border-color: var(--primary-color, #0c3287);
    box-shadow: 0 0 0 4px rgba(12, 50, 135, 0.1);
}

#step4 .specialty-combobox__options {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    max-height: min(260px, 45vh);
    overflow-y: auto;
    z-index: 40;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

#step4 .specialty-combobox__options li {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-800, #1f2937);
    line-height: 1.35;
}

#step4 .specialty-combobox__options li:hover,
#step4 .specialty-combobox__options li:focus {
    background: rgba(12, 50, 135, 0.08);
}

#step4 .specialty-combobox__add-custom {
    display: inline-block;
    margin-top: 10px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary-color, #0c3287);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
}

#step4 .specialty-combobox__add-custom:hover {
    color: var(--primary-dark, #082766);
}

#step4 .specialty-combobox__custom-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    background: var(--gray-50, #f9fafb);
    border: 1px dashed var(--gray-300, #d1d5db);
}

#step4 .specialty-combobox__custom-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--gray-800, #1f2937);
}

#step4 .specialty-combobox__custom-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

#step4 .specialty-combobox__back {
    margin-top: 10px;
    width: 100%;
}

/* Password strength + confirmation (step 4 credentials) */
#step4 .form-row--passwords .form-group--password {
    align-self: flex-start;
}

#step4 .password-rules {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--gray-600, #4b5563);
}

#step4 .password-rules__item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

#step4 .password-rules__item:last-child {
    margin-bottom: 0;
}

#step4 .password-rules__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.75rem;
}

#step4 .password-rules__item.is-idle .password-rules__icon::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-300, #d1d5db);
}

#step4 .password-rules__item.is-unmet .password-rules__icon::before {
    content: '·';
    color: var(--gray-400, #9ca3af);
    font-size: 1.1rem;
    line-height: 1;
}

#step4 .password-rules__item.is-met {
    color: var(--success-color, #059669);
    font-weight: 500;
}

#step4 .password-rules__item.is-met .password-rules__icon::before {
    content: '✓';
    color: var(--success-color, #059669);
}

#step4 #regPassword.password-field--policy-met {
    border-color: var(--success-color, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

#step4 #regPassword.password-field--policy-partial {
    border-color: var(--gray-300, #d1d5db);
}

#step4 #regPasswordConfirm.password-field--match-yes {
    border-color: var(--success-color, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

#step4 #regPasswordConfirm.password-field--match-no {
    border-color: var(--error-color, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#step4 .password-match-status {
    min-height: 1.35em;
    margin: 8px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
}

#step4 .password-match-status:empty {
    margin-top: 4px;
    min-height: 0;
}

#step4 .password-match-status.is-ok {
    color: var(--success-color, #059669);
}

#step4 .password-match-status.is-bad {
    color: var(--error-color, #dc2626);
}

.radio-group-inline,
.form-row .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-right: 20px;
}

.radio-label input[type="radio"] {
    margin-right: 6px;
}

/* Legal consent: terms and privacy – compact redesign */
.legal-consent {
    margin-bottom: 1.25rem;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.legal-consent__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    margin: 0 0 0.25rem 0;
}
.legal-consent__intro {
    font-size: 0.875rem;
    color: var(--gray-600, #4b5563);
    margin: 0 0 0.5rem 0;
}
.legal-consent__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.legal-consent__list li {
    margin-bottom: 0.4rem;
}
.legal-consent__list li:last-child {
    margin-bottom: 0;
}
.legal-consent__item {
    display: flex;
    align-items: flex-start;
    gap: 0.4em;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700, #374151);
    line-height: 1.4;
}
.legal-consent__item input[type="checkbox"] {
    margin-top: 0.2em;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    cursor: pointer;
    accent-color: var(--primary-color, #0066CC);
}
.legal-consent__item span {
    flex: 0 1 auto;
}
.legal-consent__item a {
    color: var(--primary-color, #0066CC);
    text-decoration: underline;
}
.legal-consent__item a:hover {
    text-decoration: none;
}

/* Terms checkboxes: hide native checkbox so only the custom .checkmark shows (one checkmark) */
.registration-form .checkbox-group .checkbox-label {
    position: relative;
}
.registration-form .checkbox-group .checkbox-label input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 2px;
    opacity: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

/* Review & Upgrades Section */
.review-upgrades-container {
    max-width: 1000px;
    margin: 0 auto;
}

.service-review-section {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.service-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.service-review-header h3 {
    font-size: var(--font-size-2xl);
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-review-header h3 i {
    color: var(--primary-color);
}

.selected-plan-badge {
    background: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.upgrade-section {
    margin-top: 25px;
}

.upgrade-section h4 {
    font-size: var(--font-size-lg);
    color: var(--gray-900);
    margin-bottom: 20px;
}

.upgrade-item {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upgrade-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(12, 50, 135, 0.1);
}

.upgrade-info {
    margin-bottom: 15px;
}

.upgrade-info label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--gray-900);
    font-size: var(--font-size-base);
    margin-bottom: 8px;
}

.upgrade-info label i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.upgrade-info small {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.upgrade-info strong {
    color: var(--primary-color);
}

.upgrade-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.btn-upgrade-decrease,
.btn-upgrade-increase {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 8px;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-upgrade-decrease:hover,
.btn-upgrade-increase:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.btn-upgrade-decrease:disabled,
.btn-upgrade-increase:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-controls input[type="number"] {
    width: 80px;
    padding: 10px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
    background: white;
}

.upgrade-unit {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.upgrade-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

.cost-label {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.cost-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.review-total-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    color: white;
}

.review-total-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.review-total-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.review-total-value {
    font-size: var(--font-size-4xl);
    font-weight: 700;
}

.review-total-breakdown {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: var(--font-size-sm);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: var(--font-size-lg);
}

/* Confirmation Summary */
.confirmation-summary {
    max-width: 900px;
    margin: 0 auto;
}

.summary-upgrades {
    margin-left: 20px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-upgrades small {
    color: var(--gray-600);
    font-size: var(--font-size-xs);
    padding-left: 10px;
}

.summary-upgrade {
    background: var(--gray-50);
    padding-left: 20px;
}

.summary-section {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
}

.summary-section h3 {
    font-size: var(--font-size-xl);
    color: var(--gray-900);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-section h3 i {
    color: var(--primary-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-100);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item-label {
    color: var(--gray-700);
    font-weight: 500;
}

.summary-item-value {
    color: var(--gray-900);
    font-weight: 600;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    margin-top: 20px;
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.confirmation-note {
    display: flex;
    gap: 20px;
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 16px;
    padding: 25px;
    margin: 30px 0;
}

.note-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.note-content {
    flex: 1;
    color: var(--gray-700);
    line-height: 1.6;
}

.note-content strong {
    color: var(--gray-900);
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--gray-100);
}

.step-actions .btn {
    min-width: 150px;
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.success-modal-content {
    background: white;
    padding: 60px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.success-icon-large {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-modal-content h2 {
    font-size: var(--font-size-3xl);
    color: var(--gray-900);
    margin-bottom: 15px;
}

.success-modal-content p {
    color: var(--gray-600);
    margin-bottom: 30px;
}

.success-spinner {
    margin-top: 20px;
}

/* Alert modal (replaces browser alert - no "localhost" in title) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.modal-overlay-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-overlay-body p {
    color: var(--gray-800, #1f2937);
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .registration-flow {
        padding: 60px 10px 10px;
        min-height: 100vh;
    }

    .progress-container {
        padding: 12px 10px;
    }

    /* Connector lines use .progress-steps variables — do not override here */

    .step-content {
        padding: 16px 12px;
    }

    .step-header h1 {
        font-size: var(--font-size-3xl);
    }

    #step1 .service-selection {
        flex-direction: column;
        gap: 10px;
    }

    #step1 .service-card {
        min-height: 0;
    }

    .service-selection,
    .subscription-options {
        grid-template-columns: 1fr;
    }

    .plans-grid-register {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .step-actions {
        flex-direction: column;
        gap: 10px;
    }

    .step-actions .btn {
        width: 100%;
    }

    .plan-card-register.featured {
        transform: none;
    }

    .subscription-card.featured {
        transform: none;
    }
}

@media (max-height: 700px) {
    .registration-flow {
        padding: 60px 12px 8px;
    }

    #step1 .step-header h1 {
        font-size: 1.15rem;
    }

    #step1 .service-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    #step1 .service-card h3 {
        font-size: 1rem;
    }

    #step1 .service-description,
    #step1 .feature-item {
        font-size: 0.8rem;
    }
}

/* ---- Step 0: account type (patient vs doctor) ---- */
.registration-type-choice {
    display: flex;
    gap: clamp(1rem, 4vw, 2rem);
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.btn-registration-type {
    padding: clamp(1.25rem, 4vw, 2rem) clamp(2rem, 5vw, 3rem);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 12px;
    border: 2px solid var(--primary-color, #0066CC);
    background: #f0f7ff;
    color: var(--primary-color, #0066CC);
    cursor: pointer;
    min-width: min(200px, 100%);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-registration-type:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(12, 50, 135, 0.15);
    background: #e6f2ff;
}

.btn-registration-type:focus-visible {
    outline: 2px solid var(--primary-color, #0066CC);
    outline-offset: 3px;
}

.btn-registration-type__icon {
    display: block;
    margin: 0 auto 0.5rem;
    font-size: clamp(1.75rem, 5vw, 2rem);
}

/* ---- Patient standalone registration wizard (#stepPatient) ---- */
#stepPatient .patient-reg-header__subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    color: var(--gray-600, #64748b);
    font-weight: 500;
    margin: 0.35rem 0 0;
}

#stepPatient .patient-register-form {
    max-width: 520px;
    margin: 0 auto 2rem;
    width: 100%;
}

#stepPatient .patient-reg-progress {
    max-width: 520px;
    margin: 0 auto 1.5rem;
    padding: clamp(14px, 3vw, 20px) clamp(12px, 3vw, 20px);
    background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 100%);
    border: 1px solid rgba(12, 50, 135, 0.12);
    border-radius: 14px;
    box-sizing: border-box;
}

#stepPatient .patient-reg-progress__bar {
    height: 6px;
    border-radius: 6px;
    background: var(--gray-200, #e5e7eb);
    overflow: hidden;
    margin-bottom: 10px;
}

#stepPatient .patient-reg-progress__fill {
    height: 100%;
    width: 25%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary-color, #0c3287), var(--primary-dark, #082766));
    transition: width 0.35s ease;
}

#stepPatient .patient-reg-progress__caption {
    margin: 0 0 12px;
    font-size: clamp(0.85rem, 2.8vw, 0.95rem);
    font-weight: 600;
    color: var(--gray-800, #1f2937);
    line-height: 1.4;
    text-align: center;
}

#stepPatient .patient-reg-progress__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
}

#stepPatient .patient-reg-progress__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: clamp(0.68rem, 2.4vw, 0.78rem);
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

#stepPatient .patient-reg-progress__chip.is-done {
    color: var(--success-color, #059669);
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.06);
}

#stepPatient .patient-reg-progress__chip.is-current {
    color: white;
    background: var(--primary-color, #0c3287);
    border-color: var(--primary-color, #0c3287);
    box-shadow: 0 2px 8px rgba(12, 50, 135, 0.25);
}

#stepPatient .patient-reg-panel {
    padding: clamp(18px, 3vw, 26px) clamp(14px, 3vw, 22px);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
}

#stepPatient .patient-reg-panel[hidden] {
    display: none !important;
}

#stepPatient .patient-reg-progress[hidden],
#stepPatient .patient-reg-actions[hidden] {
    display: none !important;
}

#stepPatient .patient-reg-panel__title {
    font-size: clamp(1.05rem, 3vw, 1.2rem);
    margin: 0 0 0.35rem;
    color: var(--gray-900, #111827);
}

#stepPatient .patient-reg-panel__hint {
    font-size: 0.9rem;
    color: var(--gray-600, #64748b);
    margin: 0 0 1.1rem;
    line-height: 1.45;
}

#stepPatient .patient-reg-field-hint {
    font-size: 0.875rem;
    margin-top: 0.35rem;
    margin-bottom: 0;
}

#stepPatient .patient-reg-field-hint--ok {
    color: var(--success-color, #059669);
}

#stepPatient .patient-reg-field-hint--warn {
    color: #b45309;
}

#stepPatient .patient-reg-field-hint--error {
    color: var(--error-color, #dc2626);
}

#stepPatient .patient-reg-field-hint--error a {
    color: var(--primary-color, #0c3287);
    text-decoration: underline;
    font-weight: 600;
}

#stepPatient .patient-reg-field-hint--error a:hover {
    text-decoration: none;
}

#stepPatient .password-input-wrap {
    position: relative;
}

#stepPatient .password-input-wrap .form-control {
    padding-right: 2.75rem;
}

#stepPatient .password-input-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--gray-500, #6b7280);
    cursor: pointer;
    border-radius: 6px;
}

#stepPatient .password-input-toggle:hover {
    color: var(--primary-color, #0c3287);
}

#stepPatient .password-input-toggle:focus-visible {
    outline: 2px solid var(--primary-color, #0c3287);
    outline-offset: 2px;
}

#stepPatient .patient-reg-actions [hidden] {
    display: none !important;
}

#stepPatient .patient-reg-password-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

#stepPatient .patient-password-rules {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--gray-600, #4b5563);
}

#stepPatient .patient-password-rules .password-rules__item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

#stepPatient .patient-password-rules .password-rules__item:last-child {
    margin-bottom: 0;
}

#stepPatient .patient-password-rules .password-rules__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.75rem;
}

#stepPatient .patient-password-rules .password-rules__item.is-idle .password-rules__icon::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-300, #d1d5db);
}

#stepPatient .patient-password-rules .password-rules__item.is-unmet .password-rules__icon::before {
    content: '·';
    color: var(--gray-400, #9ca3af);
    font-size: 1.1rem;
    line-height: 1;
}

#stepPatient .patient-password-rules .password-rules__item.is-met {
    color: var(--success-color, #059669);
    font-weight: 500;
}

#stepPatient .patient-password-rules .password-rules__item.is-met .password-rules__icon::before {
    content: '✓';
    color: var(--success-color, #059669);
}

#stepPatient #patientPassword.password-field--policy-met {
    border-color: var(--success-color, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

#stepPatient #patientPassword.password-field--policy-partial {
    border-color: var(--gray-300, #d1d5db);
}

#stepPatient #patientConfirmPassword.password-field--match-yes {
    border-color: var(--success-color, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

#stepPatient #patientConfirmPassword.password-field--match-no {
    border-color: var(--error-color, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#stepPatient .password-match-status {
    min-height: 1.35em;
    margin: 8px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
}

#stepPatient .password-match-status.is-ok {
    color: var(--success-color, #059669);
}

#stepPatient .password-match-status.is-bad {
    color: var(--error-color, #dc2626);
}

#stepPatient .legal-consent--patient {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

#stepPatient .patient-reg-alert {
    margin-bottom: 1rem;
}

#stepPatient .patient-reg-actions {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: stretch;
}

#stepPatient .patient-reg-actions .btn-large {
    flex: 1 1 auto;
    min-width: min(160px, 42vw);
    min-height: 48px;
}

#stepPatient .patient-reg-actions .btn-secondary {
    flex: 0 1 auto;
}

@media (max-width: 520px) {
    #stepPatient .patient-reg-actions .btn-large {
        flex: 1 1 100%;
    }

    #stepPatient .patient-reg-actions .btn-secondary {
        flex: 1 1 calc(50% - 6px);
    }
}

#stepPatient .patient-reg-success {
    text-align: center;
    padding: 2rem 1rem 1.25rem;
    margin-top: 0.25rem;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.06) 0%, rgba(12, 50, 135, 0.04) 100%);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

#stepPatient .patient-reg-success[hidden] {
    display: none !important;
}

#stepPatient .patient-reg-success__icon {
    margin: 0 auto 1rem;
    font-size: 3.5rem;
    line-height: 1;
    color: var(--success-color, #059669);
    animation: scaleIn 0.45s ease;
}

#stepPatient .patient-reg-success__title {
    font-size: var(--font-size-2xl, 1.5rem);
    color: var(--primary-color, #0c3287);
    margin: 0 0 0.65rem;
    font-weight: 700;
}

#stepPatient .patient-reg-success__text {
    color: var(--gray-600, #4b5563);
    margin: 0 0 1rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

#stepPatient .patient-reg-success__countdown {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--gray-500, #6b7280);
    margin: 0 0 1.25rem;
}

#stepPatient .patient-reg-success__countdown #patientRegSuccessCountdown {
    font-weight: 600;
    color: var(--primary-color, #0c3287);
}

#stepPatient .patient-reg-success__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: min(220px, 100%);
    min-height: 48px;
    text-decoration: none;
}

/* Patient reactivation modal */
.patient-reactivate-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 1rem;
    box-sizing: border-box;
}

.patient-reactivate-modal.patient-reactivate-modal--open {
    display: flex;
}

.patient-reactivate-modal__box {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.patient-reactivate-modal__title {
    font-size: 1.2rem;
    margin: 0 0 0.75rem;
    color: var(--primary-color, #0c3287);
}

.patient-reactivate-modal__text {
    margin: 0 0 1rem;
    color: var(--gray-600, #4b5563);
    font-size: 0.95rem;
    line-height: 1.5;
}

.patient-reactivate-modal__status {
    min-height: 1.25rem;
    font-size: 0.875rem;
    color: var(--success-color, #059669);
}

.patient-reactivate-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}