/* Pakistan Gas Bill Checker v2.1.0 */
.pgbc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 520px;
    margin: 20px auto;
}
.pgbc-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    overflow: hidden;
}

/* Header */
.pgbc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 28px 20px;
    background: linear-gradient(135deg, #1a56db 0%, #1e429f 100%);
    color: #fff;
}
.pgbc-logo svg { width: 44px; height: 44px; flex-shrink: 0; }
.pgbc-title { margin: 0; font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; }
.pgbc-subtitle { margin: 4px 0 0; font-size: 13px; color: rgba(255,255,255,0.82); }

/* Form */
.pgbc-form-section { padding: 24px 28px 28px; }
.pgbc-field { margin-bottom: 18px; }
.pgbc-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 7px; }
.pgbc-hint { display: block; font-size: 12px; color: #9ca3af; margin-top: 5px; }
.pgbc-input {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    font-size: 15px; color: #111827; background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box; outline: none;
}
.pgbc-input:focus { border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,0.12); background: #fff; }

/* Company Tabs */
.pgbc-company-tabs { display: flex; gap: 10px; }
.pgbc-tab {
    flex: 1; padding: 9px 0;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    background: #f9fafb; color: #6b7280;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all 0.18s; letter-spacing: 0.5px;
}
.pgbc-tab:hover { border-color: #1a56db; color: #1a56db; background: #eff6ff; }
.pgbc-tab.active { background: #1a56db; border-color: #1a56db; color: #fff; }

/* Primary Button */
.pgbc-btn-primary {
    width: 100%; padding: 13px;
    background: #1a56db; color: #fff;
    border: none; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: background 0.18s, opacity 0.18s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 4px; letter-spacing: 0.3px;
}
.pgbc-btn-primary:hover:not(:disabled) { background: #1e429f; }
.pgbc-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* Spinner */
.pgbc-spinner, .pgbc-captcha-spinner2 {
    width: 17px; height: 17px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff; border-radius: 50%;
    animation: pgbc-spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes pgbc-spin { to { transform: rotate(360deg); } }

/* Error */
.pgbc-error, .pgbc-captcha-error {
    margin-top: 14px; padding: 11px 14px;
    background: #fef2f2; border: 1px solid #fca5a5;
    border-radius: 8px; color: #b91c1c;
    font-size: 13.5px; line-height: 1.5;
}

/* Save number checkbox */
.pgbc-save-label {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px; cursor: pointer; user-select: none;
    font-size: 13px; color: #6b7280;
}
.pgbc-save-label input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: #1a56db; cursor: pointer; flex-shrink: 0;
}
.pgbc-saved-badge { margin-left: auto; font-size: 11px; font-weight: 700; color: #10b981; }

/* ── Manual Captcha Section ─────────────────────────────────────────────── */
.pgbc-captcha-section { padding: 20px 28px 28px; }

.pgbc-captcha-info {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 18px;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
    font-size: 13px; color: #92400e; line-height: 1.5;
}

.pgbc-captcha-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.pgbc-captcha-img-wrap {
    flex: 1; position: relative; min-height: 50px;
    background: #f9fafb; border: 1.5px solid #d1d5db; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pgbc-captcha-img {
    display: block; max-width: 100%; height: auto; border-radius: 6px;
    image-rendering: pixelated;
}
.pgbc-captcha-spinner {
    width: 20px; height: 20px;
    border: 2.5px solid #d1d5db;
    border-top-color: #1a56db; border-radius: 50%;
    animation: pgbc-spin 0.7s linear infinite;
}

.pgbc-refresh-btn {
    flex-shrink: 0; width: 40px; height: 40px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    background: #f9fafb; color: #374151;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
}
.pgbc-refresh-btn:hover { border-color: #1a56db; color: #1a56db; background: #eff6ff; }

.pgbc-back-to-form-btn {
    display: block; width: 100%; margin-top: 10px;
    padding: 9px; background: transparent;
    border: none; color: #9ca3af; font-size: 13px;
    cursor: pointer; text-align: center;
    transition: color 0.18s;
}
.pgbc-back-to-form-btn:hover { color: #374151; }

/* Result */
.pgbc-result-section { padding: 0 28px 28px; }
.pgbc-result-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0 18px; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px;
}
.pgbc-back-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: 1.5px solid #d1d5db; border-radius: 8px;
    background: #f9fafb; color: #374151; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.18s;
}
.pgbc-back-btn:hover { border-color: #1a56db; color: #1a56db; }
.pgbc-company-badge {
    font-size: 12px; font-weight: 700; letter-spacing: 1px;
    padding: 4px 12px; border-radius: 20px;
    background: #eff6ff; color: #1a56db;
}
.pgbc-bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.pgbc-bill-item { background: #f9fafb; border-radius: 10px; padding: 12px 14px; border: 1px solid #e5e7eb; }
.pgbc-bill-item.full-width { grid-column: 1 / -1; }
.pgbc-bill-item.highlight { background: #eff6ff; border-color: #bfdbfe; }
.pgbc-bill-key { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.pgbc-bill-value { font-size: 15px; font-weight: 600; color: #111827; word-break: break-word; }
.pgbc-bill-item.highlight .pgbc-bill-value { color: #1a56db; font-size: 18px; }

/* Print / Download PDF button */
.pgbc-print-btn {
    width: 100%; padding: 11px 13px;
    background: #fff; color: #1a56db; border: 1.5px solid #1a56db;
    border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    letter-spacing: 0.3px; transition: background 0.18s;
}
.pgbc-print-btn:hover { background: #eff6ff; }

/* Print media */
@media print {
    body > *:not(.pgbc-print-target) { display: none !important; }
    .pgbc-print-target { display: block !important; position: static !important; width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; }
    .pgbc-form-section, .pgbc-captcha-section, .pgbc-back-btn, .pgbc-print-btn { display: none !important; }
    .pgbc-result-section { display: block !important; padding: 20px !important; }
    .pgbc-bill-grid { grid-template-columns: 1fr 1fr !important; }
    .pgbc-card { box-shadow: none !important; border: 1px solid #e5e7eb !important; }
}

@media (max-width: 480px) {
    .pgbc-card { border-radius: 12px; }
    .pgbc-header, .pgbc-form-section, .pgbc-captcha-section, .pgbc-result-section { padding-left: 16px; padding-right: 16px; }
    .pgbc-bill-grid { grid-template-columns: 1fr; }
    .pgbc-bill-item.full-width { grid-column: 1; }
}
