/* ═══════════════════════════════════════════════════════════════════════════
   SMEBizness AI Preview Widget — Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --smbpw-primary:   #e63946;
    --smbpw-secondary: #1d3557;
    --smbpw-accent:    #457b9d;
    --smbpw-light:     #f8f9fa;
    --smbpw-border:    #e0e0e0;
    --smbpw-text:      #333;
    --smbpw-muted:     #777;
    --smbpw-radius:    10px;
    --smbpw-shadow:    0 20px 60px rgba(0,0,0,0.18);
}

/* ── Modal Overlay ─────────────────────────────────────────────────────────── */
.smbpw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: smbpwFadeIn 0.25s ease;
}

@keyframes smbpwFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
select#smbpw-biz-type {
    height: 50px;
}
.smbpw-modal .smbpw-close {
    position: absolute !important;
    top: 14px !important;
    right: 16px !important;

    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;

    padding: 0 !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: transparent !important;
    border: none !important;
    box-shadow: none !important;

    color: #fff !important;
    font-size: 24px !important;
    line-height: 1 !important;

    cursor: pointer !important;
    z-index: 999999 !important;
}

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

.smbpw-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--smbpw-muted);
    z-index: 10;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.smbpw-close:hover { background: #f0f0f0; color: #333; }

/* ── Widget Container ──────────────────────────────────────────────────────── */
.smbpw-widget {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--smbpw-text);
    line-height: 1.5;
    background: #fff;
}

.smbpw-widget.popup-mode {
    padding: 32px 36px 28px;
}

.smbpw-widget.inline-mode {
    padding: 40px;
    background: #fff;
    border-radius: var(--smbpw-radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

/* ── Step Indicators ───────────────────────────────────────────────────────── */
.smbpw-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    gap: 0;
}

.smbpw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--smbpw-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    text-align: center;
    transition: color 0.2s;
}

.smbpw-step span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--smbpw-border);
    color: var(--smbpw-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}

.smbpw-step.active span {
    background: var(--smbpw-primary);
    color: #fff;
}

.smbpw-step.active {
    color: var(--smbpw-primary);
}

.smbpw-step.done span {
    background: #28a745;
    color: #fff;
}

.smbpw-step-line {
    flex: 1;
    height: 2px;
    background: var(--smbpw-border);
    margin: 0 4px;
    margin-bottom: 16px;
    max-width: 48px;
}

/* ── Panels ────────────────────────────────────────────────────────────────── */
.smbpw-panel {
    display: none;
}
.smbpw-panel.active {
    display: block;
    animation: smbpwFadeIn 0.2s ease;
}

/* ── Panel Header ──────────────────────────────────────────────────────────── */
.smbpw-panel-header {
    margin-bottom: 24px;
}
.smbpw-panel-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--smbpw-secondary);
    margin: 0 0 8px;
    line-height: 1.25;
}
.smbpw-panel-header p {
    font-size: 14px;
    color: var(--smbpw-muted);
    margin: 0;
}

/* ── Form Fields ───────────────────────────────────────────────────────────── */
.smbpw-field {
    margin-bottom: 18px;
}

.smbpw-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.smbpw-field .req {
    color: var(--smbpw-primary);
}

.smbpw-field input[type="text"],
.smbpw-field input[type="email"],
.smbpw-field input[type="tel"],
.smbpw-field select,
.smbpw-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--smbpw-border);
    border-radius: 7px;
    font-size: 15px;
    font-family: inherit;
    color: var(--smbpw-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.smbpw-field input:focus,
.smbpw-field select:focus,
.smbpw-field textarea:focus {
    border-color: var(--smbpw-accent);
    box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.15);
}

.smbpw-field textarea {
    resize: vertical;
    min-height: 80px;
}

.smbpw-field small {
    display: block;
    font-size: 12px;
    color: var(--smbpw-muted);
    margin-top: 5px;
}

/* ── File Upload Area ──────────────────────────────────────────────────────── */
.smbpw-upload-area {
    position: relative;
    border: 2px dashed var(--smbpw-border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--smbpw-light);
}

.smbpw-upload-area:hover {
    border-color: var(--smbpw-accent);
    background: #eef4f8;
}

.smbpw-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border: none !important;
}

.smbpw-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.upload-icon { font-size: 32px; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--smbpw-secondary); }
.upload-hint { font-size: 12px; color: var(--smbpw-muted); }

.smbpw-logo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.smbpw-logo-preview img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    border-radius: 4px;
}
.smbpw-remove-logo {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--smbpw-muted);
}

/* ── Colour Pickers ────────────────────────────────────────────────────────── */
.smbpw-colors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.smbpw-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smbpw-color-wrap input[type="color"] {
    width: 44px !important;
    height: 44px !important;
    padding: 2px !important;
    border-radius: 6px !important;
    cursor: pointer;
    flex-shrink: 0;
}

.color-label {
    font-size: 13px;
    color: var(--smbpw-muted);
}

/* ── GDPR Checkbox ─────────────────────────────────────────────────────────── */
.smbpw-gdpr {
    margin-top: 8px;
}

.smbpw-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px !important;
    color: var(--smbpw-muted) !important;
    font-weight: normal !important;
    cursor: pointer;
}

.smbpw-checkbox-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.smbpw-checkbox-label a {
    color: var(--smbpw-accent);
}

/* ── Navigation Buttons ────────────────────────────────────────────────────── */
.smbpw-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
}

.smbpw-btn-next,
.smbpw-btn-generate {
    flex: 1;
    background: var(--smbpw-primary);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
}

.smbpw-btn-next:hover,
.smbpw-btn-generate:hover {
    opacity: 0.88;
}

.smbpw-btn-next:active,
.smbpw-btn-generate:active {
    transform: scale(0.98);
}

.smbpw-btn-back {
    background: none;
    border: 1.5px solid var(--smbpw-border);
    color: var(--smbpw-muted);
    padding: 12px 18px;
    border-radius: 7px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.smbpw-btn-back:hover {
    border-color: var(--smbpw-secondary);
    color: var(--smbpw-secondary);
}

/* ── Loading State ─────────────────────────────────────────────────────────── */
.smbpw-loading {
    text-align: center;
    padding: 20px 0;
}

.smbpw-loading h2 {
    font-size: 22px;
    color: var(--smbpw-secondary);
    margin: 20px 0 16px;
}

.smbpw-loading p {
    font-size: 14px;
    color: var(--smbpw-muted);
    margin-top: 12px;
}

.smbpw-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid var(--smbpw-border);
    border-top-color: var(--smbpw-primary);
    border-radius: 50%;
    animation: smbpwSpin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes smbpwSpin {
    to { transform: rotate(360deg); }
}

.smbpw-progress-bar {
    background: var(--smbpw-border);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin: 16px 0 8px;
}

.smbpw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--smbpw-primary), var(--smbpw-accent));
    border-radius: 20px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ── Result State ──────────────────────────────────────────────────────────── */
.smbpw-result {
    text-align: center;
    padding: 10px 0;
}

.smbpw-success-icon {
    font-size: 52px;
    margin-bottom: 12px;
}

.smbpw-result h2 {
    font-size: 24px;
    color: var(--smbpw-secondary);
    margin-bottom: 10px;
}

.smbpw-result p {
    font-size: 15px;
    color: var(--smbpw-muted);
    margin-bottom: 20px;
}

.smbpw-preview-btn {
    display: inline-block;
    background: var(--smbpw-primary);
    color: #fff;
    padding: 15px 32px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 16px;
    transition: opacity 0.2s;
    margin-bottom: 16px;
}

.smbpw-preview-btn:hover { opacity: 0.88; }

.smbpw-result-note {
    font-size: 13px !important;
    color: var(--smbpw-muted) !important;
    margin: 12px 0 20px !important;
}

.smbpw-btn-contact {
    display: block;
    width: 100%;
    background: var(--smbpw-secondary);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.smbpw-btn-contact:hover { opacity: 0.88; }

/* ── Error State ───────────────────────────────────────────────────────────── */
.smbpw-error {
    text-align: center;
    padding: 10px 0;
}

.smbpw-error-icon { font-size: 48px; margin-bottom: 12px; }

.smbpw-error h2 {
    font-size: 20px;
    color: var(--smbpw-secondary);
    margin-bottom: 8px;
}

.smbpw-error p {
    font-size: 14px;
    color: var(--smbpw-muted);
    margin-bottom: 20px;
}

/* ── Trigger Button (shortcode) ────────────────────────────────────────────── */
.smbpw-open-popup {
    background: var(--smbpw-primary);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 7px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
}

.smbpw-open-popup:hover { opacity: 0.88; }
.smbpw-open-popup:active { transform: scale(0.97); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .smbpw-widget.popup-mode { padding: 24px 20px 20px; }
    .smbpw-widget.inline-mode { padding: 24px 20px; }
    .smbpw-colors { grid-template-columns: 1fr; }
    .smbpw-steps { gap: 0; }
    .smbpw-step { font-size: 10px; min-width: 48px; }
    .smbpw-panel-header h2 { font-size: 19px; }
}

/* ── Customer template selection ── */
.smbpw-template-choice {
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--smbpw-border);
    border-radius: 8px;
    background: #fafafa;
}
.smbpw-template-choice label {
    font-weight: 700;
}
.smbpw-template-choice small {
    margin-top: 6px;
}
