/* Help Portal Styles */

.help-hero {
    padding: 120px 50px 60px;
    background-color: #fdfcfd;
    text-align: center;
}

.help-hero-container {
    max-width: 700px;
    margin: 0 auto;
}

.help-hero-title {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 400;
    color: #151515;
    margin: 0 0 16px 0;
}

.help-hero-subtitle {
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    color: #737373;
    margin: 0 0 40px 0;
}

.help-search {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
}

.help-search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    color: #151515;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-search-input::placeholder {
    color: #a3a3a3;
}

.help-search-input:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Inline Chat Widget */
.help-chat {
    max-width: 520px;
    margin: 32px auto 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.help-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e5e5;
    background-color: #fafafa;
}

.help-chat-header svg {
    color: #ff6b35;
    flex-shrink: 0;
}

.help-chat-header span {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: #151515;
}

.help-chat-messages {
    min-height: 180px;
    max-height: 300px;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-chat-welcome {
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #737373;
    text-align: center;
    padding: 20px 12px;
}

.help-chat-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.help-chat-msg-user {
    align-self: flex-end;
    background-color: #ff6b35;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.help-chat-msg-bot {
    align-self: flex-start;
    background-color: #f5f5f5;
    color: #151515;
    border-bottom-left-radius: 4px;
}

.help-chat-msg-bot p {
    margin: 0 0 8px 0;
}

.help-chat-msg-bot p:last-child {
    margin-bottom: 0;
}

.help-chat-msg-bot ul,
.help-chat-msg-bot ol {
    margin: 4px 0 8px 0;
    padding-left: 20px;
}

.help-chat-msg-bot li {
    margin-bottom: 2px;
}

.help-chat-msg-bot strong {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
}

.help-chat-msg-bot a {
    color: #ff6b35;
    text-decoration: none;
}

.help-chat-msg-bot a:hover {
    text-decoration: underline;
}

.help-chat-msg-bot code {
    background: #e5e5e5;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}

.help-chat-msg-error {
    align-self: flex-start;
    background-color: #fef2f2;
    color: #dc2626;
    border-bottom-left-radius: 4px;
}

.help-chat-msg-loading {
    padding: 10px 14px;
}

.help-chat-dots {
    display: inline-flex;
    gap: 4px;
}

.help-chat-dots span {
    width: 6px;
    height: 6px;
    background: #a3a3a3;
    border-radius: 50%;
    animation: helpChatDot 1.2s infinite;
}

.help-chat-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.help-chat-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes helpChatDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.help-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.help-chat-input textarea {
    flex: 1;
    padding: 9px 12px;
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #151515;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease;
    resize: none;
    overflow-y: hidden;
    min-height: 38px;
    max-height: 120px;
    line-height: 1.4;
}

.help-chat-input textarea:focus {
    border-color: #ff6b35;
}

.help-chat-input textarea::placeholder {
    color: #a3a3a3;
}

.help-chat-input button {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.help-chat-input button:hover {
    background-color: #e55a2b;
}

.help-chat-input button:disabled {
    background-color: #d4d4d4;
    color: #a3a3a3;
    cursor: not-allowed;
}

.help-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #a3a3a3;
    pointer-events: none;
}

/* Articles Grid */
.help-articles {
    padding: 60px 50px 120px;
    background-color: #ffffff;
}

.help-articles-container {
    max-width: 1000px;
    margin: 0 auto;
}

.help-articles-heading {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #151515;
    margin: 0 0 32px 0;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.help-card {
    display: block;
    padding: 28px;
    background-color: #fafafa;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.help-card:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.help-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff7ed;
    border-radius: 10px;
    margin-bottom: 16px;
}

.help-card-icon svg {
    color: #ff6b35;
}

.help-card-title {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #151515;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.help-card-excerpt {
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #737373;
    line-height: 1.6;
    margin: 0;
}

.help-no-results {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.help-no-results p {
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    color: #737373;
}

/* Article page */
.help-article-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 100px 50px 80px;
}

.help-article-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #737373;
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.2s ease;
}

.help-article-back:hover {
    color: #ff6b35;
}

.help-article-title {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    color: #151515;
    margin: 0 0 16px 0;
}

.help-article-meta {
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #737373;
    margin: 0 0 48px 0;
}

.help-article-content {
    font-family: "BR Sonoma Regular", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #333;
}

.help-article-content h2 {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: #151515;
    margin: 48px 0 20px 0;
}

.help-article-content h3 {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: #151515;
    margin: 32px 0 16px 0;
}

.help-article-content p {
    margin: 0 0 20px 0;
}

.help-article-content ul,
.help-article-content ol {
    margin: 0 0 24px 0;
    padding-left: 24px;
}

.help-article-content li {
    margin-bottom: 12px;
}

.help-article-content code {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 0.95em;
    background-color: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    color: #ff6b35;
}

.help-article-intro {
    font-size: 1.15rem;
    color: #525252;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Provider table */
.provider-section {
    margin: 32px 0;
    background-color: #fafafa;
    border-radius: 12px;
    padding: 24px;
}

.provider-section h3 {
    margin-top: 0 !important;
}

.provider-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 0 0;
}

.provider-table th {
    text-align: left;
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
}

.provider-table td {
    font-size: 15px;
    color: #333;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
}

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

.provider-table code {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 0.9em;
    background-color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    color: #ff6b35;
}

.provider-note {
    font-size: 14px;
    color: #737373;
    margin: 12px 0 0 0;
    font-style: italic;
}

/* Callout */
.help-callout {
    display: flex;
    gap: 16px;
    padding: 20px;
    background-color: #fff7ed;
    border-left: 4px solid #ff6b35;
    border-radius: 0 12px 12px 0;
    margin: 28px 0;
}

.help-callout.warning {
    background-color: #fef2f2;
    border-left-color: #dc2626;
}

.help-callout-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.help-callout p {
    margin: 0;
    font-size: 15px;
    color: #333;
}

.help-callout strong {
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Steps */
.help-steps {
    margin: 24px 0;
    counter-reset: step-counter;
}

.help-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.help-step:last-child {
    border-bottom: none;
}

.help-step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ff6b35;
    color: #fff;
    font-family: "BR Sonoma Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.help-step-text {
    padding-top: 4px;
    font-size: 16px;
    color: #333;
}

/* Mobile */
@media (max-width: 768px) {
    .help-hero {
        padding: 100px 24px 40px;
    }

    .help-articles {
        padding: 40px 24px 80px;
    }

    .help-grid {
        grid-template-columns: 1fr;
    }

    .help-article-main {
        padding: 80px 24px 60px;
    }

    .provider-table th:first-child,
    .provider-table td:first-child {
        min-width: 100px;
    }

    .help-chat {
        margin-top: 24px;
    }

    .help-chat-messages {
        min-height: 140px;
        max-height: 240px;
    }
}
