/* ════════════════════════════════════════════════════════════════════════
   Patient Intake Form — Public Page Styles
   Prefix: pi-
   ════════════════════════════════════════════════════════════════════════ */

/* ── Page Layouts ── */
.pi-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #F9F7F2 0%, #f0ede6 100%);
    font-family: var(--lk-font-sans);
    padding: 2rem 1rem;
}

.pi-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pi-container {
    max-width: 720px;
    margin: 0 auto;
}

/* ── Animations ── */
.pi-animate-in {
    animation: piFadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes piFadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.pi-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pi-logo {
    max-width: 140px;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* ── Stepper ── */
.pi-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.pi-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    min-width: 60px;
}

.pi-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pi-step--pending .pi-step-dot {
    background: #e2e8f0;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.pi-step--active .pi-step-dot {
    background: #3E6D66;
    color: white;
    border-color: #3E6D66;
    box-shadow: 0 2px 8px rgba(62, 109, 102, 0.3);
}

.pi-step--done .pi-step-dot {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.pi-step-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.pi-step--active .pi-step-label {
    color: #3E6D66;
    font-weight: 600;
}

.pi-step--done .pi-step-label {
    color: #22c55e;
}

.pi-step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.25rem;
    margin-bottom: 1.25rem;
    border-radius: 1px;
    transition: background 0.3s ease;
    min-width: 20px;
    max-width: 60px;
}

.pi-step-line--done {
    background: #22c55e;
}

/* ── Form Card ── */
.pi-form-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 1rem;
}

/* ── Section Titles ── */
.pi-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
}

/* ── Field Grid ── */
.pi-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.pi-indent {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* ── Toggle Groups ── */
.pi-toggle-group {
    margin-bottom: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.pi-toggle-group:last-child {
    border-bottom: none;
}

/* ── Nav Buttons ── */
.pi-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.pi-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pi-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pi-btn-primary {
    background: #3E6D66;
    color: white;
    box-shadow: 0 2px 8px rgba(62, 109, 102, 0.2);
}

.pi-btn-primary:hover:not(:disabled) {
    background: #345c57;
    box-shadow: 0 4px 12px rgba(62, 109, 102, 0.3);
    transform: translateY(-1px);
}

.pi-btn-outline {
    background: white;
    color: #3E6D66;
    border: 1.5px solid #3E6D66;
}

.pi-btn-outline:hover:not(:disabled) {
    background: rgba(62, 109, 102, 0.04);
}

/* ── Review Sections ── */
.pi-review-section {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pi-review-section:hover {
    border-color: #3E6D66;
    background: rgba(62, 109, 102, 0.02);
}

.pi-review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #3E6D66;
    margin-bottom: 0.75rem;
}

.pi-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

.pi-review-field {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.pi-review-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pi-review-value {
    font-size: 0.85rem;
    color: #1a1a1a;
}

/* ── Success & Error Pages ── */
.pi-success-page,
.pi-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
}

.pi-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Dialog Styles ── */
.pi-dialog {
    padding: 0.5rem 0;
    min-width: 380px;
}

.pi-active-token-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.75rem;
    padding: 1rem;
}

.pi-field-group {}

.pi-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4a5568;
    min-width: 100px;
}

.pi-method-btn:hover:not(:disabled) {
    border-color: #3E6D66;
    color: #3E6D66;
    background: rgba(62, 109, 102, 0.02);
}

.pi-method-btn--active {
    border-color: #3E6D66;
    background: rgba(62, 109, 102, 0.06);
    color: #3E6D66;
    font-weight: 600;
}

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

.pi-method-warn {
    font-size: 0.65rem;
    color: #ef4444;
    font-weight: 400;
}

.pi-success-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.75rem;
    padding: 1rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .pi-page {
        padding: 1rem 0.5rem;
    }

    .pi-form-card {
        padding: 1.25rem;
        border-radius: 1rem;
    }

    .pi-field-grid {
        grid-template-columns: 1fr;
    }

    .pi-stepper {
        padding: 0;
    }

    .pi-step-label {
        font-size: 0.6rem;
    }

    .pi-step-dot {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .pi-step-line {
        min-width: 12px;
    }

    .pi-review-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pi-dialog {
        min-width: auto;
    }

    .pi-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
}
