/* BP Support Ticket — Public Styles */
*, *::before, *::after { box-sizing: border-box; }

/* ===== AUTH ===== */
.bpst-auth-wrap {
    display: flex; justify-content: center; padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.bpst-auth-card {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 16px; padding: 2rem;
    width: 100%; max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.bpst-auth-logo { text-align: center; margin-bottom: 1.5rem; }
.bpst-auth-logo img { max-height: 72px; max-width: 180px; object-fit: contain; margin-bottom: 12px; }
.bpst-logo-placeholder { font-size: 48px; margin-bottom: 8px; }
.bpst-auth-logo h2 { margin: 0 0 4px; font-size: 20px; color: #1e293b; }
.bpst-auth-logo p  { margin: 0; color: #64748b; font-size: 14px; }

.bpst-auth-tabs {
    display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 1.25rem;
}
.bpst-auth-tab {
    flex: 1; background: none; border: none; padding: 10px;
    font-size: 14px; font-weight: 500; color: #64748b; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.bpst-auth-tab.active { color: #185FA5; border-bottom-color: #185FA5; }

.bpst-method-tabs {
    display: flex; gap: 6px; margin-bottom: 1rem; flex-wrap: wrap;
}
.bpst-method-tab {
    flex: 1; background: #f1f5f9; border: 1.5px solid transparent;
    border-radius: 8px; padding: 7px 10px; font-size: 12px;
    font-weight: 500; color: #475569; cursor: pointer; transition: all .15s;
}
.bpst-method-tab.active {
    background: #dbeafe; border-color: #185FA5; color: #185FA5;
}

.bpst-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 1rem; }
.bpst-form-group label { font-size: 13px; font-weight: 500; color: #374151; }
.bpst-form-group input,
.bpst-form-group select,
.bpst-form-group textarea {
    border: 1.5px solid #d1d5db; border-radius: 8px;
    padding: 9px 12px; font-size: 14px; color: #1e293b;
    transition: border-color .15s; font-family: inherit;
}
.bpst-form-group input:focus,
.bpst-form-group select:focus,
.bpst-form-group textarea:focus { outline: none; border-color: #185FA5; }
.bpst-req { color: #dc2626; }

.bpst-pwd-wrap { position: relative; display: flex; }
.bpst-pwd-wrap input { flex: 1; padding-right: 40px; }
.bpst-pwd-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px; padding: 0;
}

.bpst-btn-primary {
    width: 100%; background: #185FA5; color: #fff; border: none;
    border-radius: 10px; padding: 11px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background .15s;
}
.bpst-btn-primary:hover { background: #0C447C; }
.bpst-btn-outline {
    background: #fff; color: #185FA5; border: 1.5px solid #185FA5;
    border-radius: 10px; padding: 9px 20px; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .15s;
}
.bpst-btn-outline:hover { background: #dbeafe; }

.bpst-msg {
    padding: 10px 12px; border-radius: 8px;
    font-size: 13px; margin-bottom: 10px;
}
.bpst-msg.success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.bpst-msg.error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* ===== PORTAL ===== */
.bpst-portal-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 960px; margin: 0 auto; padding: 0;
}
.bpst-portal-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #185FA5; color: #fff; padding: 12px 20px;
    border-radius: 12px 12px 0 0; flex-wrap: wrap; gap: 8px;
}
.bpst-portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.bpst-topbar-logo { max-height: 36px; border-radius: 4px; background: #fff; padding: 2px 4px; }
.bpst-portal-user { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.bpst-cid-badge {
    background: rgba(255,255,255,.2); padding: 2px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 500;
}
.bpst-logout-btn {
    background: rgba(255,255,255,.15); color: #fff !important;
    padding: 4px 12px; border-radius: 6px; text-decoration: none; font-size: 12px;
    transition: background .15s;
}
.bpst-logout-btn:hover { background: rgba(255,255,255,.3); }

.bpst-portal-nav {
    display: flex; background: #f8fafc;
    border: 1px solid #e2e8f0; border-top: none;
    overflow-x: auto;
}
.bpst-nav-tab {
    padding: 12px 20px; font-size: 13px; font-weight: 500; color: #64748b;
    text-decoration: none; border-bottom: 3px solid transparent;
    white-space: nowrap; transition: all .15s;
}
.bpst-nav-tab:hover { color: #185FA5; background: #f1f5f9; }
.bpst-nav-tab.active { color: #185FA5; border-bottom-color: #185FA5; background: #fff; }

.bpst-portal-body {
    background: #fff; border: 1px solid #e2e8f0; border-top: none;
    padding: 20px; border-radius: 0 0 12px 12px; min-height: 300px;
}

/* Ticket list */
.bpst-ticket-list { display: flex; flex-direction: column; gap: 8px; }
.bpst-ticket-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border: 1.5px solid #e2e8f0; border-radius: 10px;
    text-decoration: none; color: inherit; transition: border-color .15s;
    flex-wrap: wrap; gap: 8px;
}
.bpst-ticket-row:hover { border-color: #185FA5; }
.bpst-tr-main { flex: 1; min-width: 0; }
.bpst-tr-subject { font-size: 14px; font-weight: 500; color: #1e293b; margin-bottom: 4px; }
.bpst-tr-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.bpst-tr-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bpst-tr-date { font-size: 11px; color: #94a3b8; }

/* Badges */
.bpst-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 500; background: #f1f5f9; color: #475569;
}
.status-open     { background: #dbeafe; color: #1e40af; }
.status-pending  { background: #fef3c7; color: #92400e; }
.status-resolved { background: #dcfce7; color: #166534; }
.status-closed   { background: #f1f5f9; color: #475569; }
.status-active   { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }
.priority-urgent { background: #fee2e2; color: #991b1b; }
.priority-normal { background: #e0f2fe; color: #0369a1; }
.priority-low    { background: #f1f5f9; color: #64748b; }
.bpst-cat-tag { background: #f0fdf4; color: #166534; padding: 2px 9px; border-radius: 20px; font-size: 11px; }

/* Form card */
.bpst-form-card {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 20px; max-width: 640px;
}
.bpst-form-card h3 { margin: 0 0 16px; font-size: 16px; color: #1e293b; }
.bpst-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .bpst-two-col { grid-template-columns: 1fr; } }

/* Ticket thread */
.bpst-back-link { display: inline-block; color: #185FA5; text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.bpst-ticket-thread { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.bpst-thread-header { background: #f8fafc; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.bpst-thread-header h3 { margin: 0; font-size: 16px; color: #1e293b; }
.bpst-messages { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; max-height: 420px; overflow-y: auto; }
.bpst-msg { padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.bpst-msg-customer { background: #f1f5f9; }
.bpst-msg-agent    { background: #dbeafe; }
.bpst-msg-from { font-size: 11px; font-weight: 600; margin-bottom: 4px; color: #64748b; }
.bpst-msg-agent .bpst-msg-from { color: #185FA5; }
.bpst-msg-time { font-size: 10px; color: #94a3b8; margin-top: 4px; }
.bpst-reply-area { border-top: 1px solid #e2e8f0; padding: 14px 20px; background: #fff; }
.bpst-reply-area textarea { width: 100%; border: 1.5px solid #d1d5db; border-radius: 8px; padding: 10px; font-size: 13px; font-family: inherit; resize: vertical; margin-bottom: 8px; }
.bpst-reply-area textarea:focus { outline: none; border-color: #185FA5; }

/* Subscription */
.bpst-sub-section { }
.bpst-pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.bpst-pkg-card {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 18px; text-align: center; transition: border-color .15s;
}
.bpst-pkg-card:hover { border-color: #185FA5; }
.bpst-pkg-name  { font-weight: 700; font-size: 15px; color: #1e293b; margin-bottom: 6px; }
.bpst-pkg-price { font-size: 24px; font-weight: 800; color: #185FA5; margin-bottom: 4px; }
.bpst-pkg-meta  { font-size: 11px; color: #64748b; margin-bottom: 12px; }
.bpst-select-pkg { width: 100%; }
.bpst-selected-pkg-info {
    background: #dbeafe; border: 1px solid #93c5fd; border-radius: 8px;
    padding: 10px 14px; font-size: 13px; color: #1e40af; margin-bottom: 12px;
}
.bpst-sub-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.bpst-sub-table th { background: #f8fafc; padding: 10px 12px; text-align: left; border-bottom: 2px solid #e2e8f0; font-weight: 600; }
.bpst-sub-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }

/* Empty state */
.bpst-empty { text-align: center; padding: 3rem 1rem; color: #64748b; }
.bpst-empty-icon { font-size: 48px; margin-bottom: 12px; }
.bpst-empty p { margin-bottom: 16px; font-size: 14px; }

/* Footer brand */
.bpst-footer-brand { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 1.5rem; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.bpst-footer-brand a { color: #185FA5; text-decoration: none; font-weight: 600; }
.bpst-footer-brand a:hover { text-decoration: underline; }
