/* ─── MYND LinkedIn Post Builder — Frontend Styles ─── */
:root {
    --mlpb-navy:    #253c74;
    --mlpb-pink:    #ee3897;
    --mlpb-blue:    #0c4da2;
    --mlpb-white:   #ffffff;
    --mlpb-gray-50: #f8fafc;
    --mlpb-gray-100:#f1f5f9;
    --mlpb-gray-200:#e2e8f0;
    --mlpb-gray-400:#94a3b8;
    --mlpb-gray-600:#475569;
    --mlpb-gray-800:#1e293b;
    --mlpb-radius:  12px;
    --mlpb-shadow:  0 4px 24px rgba(37,60,116,.10);
    --mlpb-font:    'Montserrat', 'Lato', -apple-system, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

.mlpb-wizard {
    font-family: var(--mlpb-font);
    max-width: 800px;
    margin: 0 auto;
    color: var(--mlpb-gray-800);
}

/* ─── Notice ─── */
.mlpb-notice {
    padding: 16px 20px;
    border-radius: var(--mlpb-radius);
    font-size: 14px;
    margin-bottom: 20px;
}
.mlpb-notice--error {
    background: #fff0f0;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.mlpb-notice a { color: var(--mlpb-navy); font-weight: 600; }

/* ─── Progress ─── */
.mlpb-progress {
    background: var(--mlpb-navy);
    border-radius: var(--mlpb-radius) var(--mlpb-radius) 0 0;
    padding: 20px 28px 0;
    color: white;
}
.mlpb-progress__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.mlpb-progress__brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}
.mlpb-progress__subtitle {
    display: block;
    font-size: 11px;
    opacity: .7;
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.mlpb-progress__steps {
    display: flex;
    gap: 8px;
    align-items: center;
}
.mlpb-step-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    transition: all .3s;
}
.mlpb-step-dot.active {
    background: var(--mlpb-pink);
    box-shadow: 0 0 0 4px rgba(238,56,151,.25);
}
.mlpb-step-dot.done {
    background: rgba(255,255,255,.9);
    color: var(--mlpb-navy);
}
.mlpb-progress__bar {
    height: 4px;
    background: rgba(255,255,255,.15);
    border-radius: 0;
    overflow: hidden;
}
.mlpb-progress__fill {
    height: 100%;
    background: var(--mlpb-pink);
    transition: width .5s ease;
}

/* ─── Screens ─── */
.mlpb-screens {
    background: var(--mlpb-white);
    border-radius: 0 0 var(--mlpb-radius) var(--mlpb-radius);
    box-shadow: var(--mlpb-shadow);
}
.mlpb-screen__inner {
    padding: 36px 40px 32px;
}
.mlpb-q-number {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mlpb-pink);
    margin-bottom: 10px;
}
.mlpb-q-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--mlpb-navy);
    margin: 0 0 24px;
    line-height: 1.35;
}
.mlpb-q-desc {
    font-size: 14px;
    color: var(--mlpb-gray-600);
    margin: -16px 0 20px;
}
.mlpb-optional {
    font-size: 14px;
    font-weight: 400;
    color: var(--mlpb-gray-400);
}

/* ─── Options ─── */
.mlpb-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}
.mlpb-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid var(--mlpb-gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    background: var(--mlpb-gray-50);
    position: relative;
}
.mlpb-option:hover {
    border-color: var(--mlpb-blue);
    background: white;
}
.mlpb-option.selected {
    border-color: var(--mlpb-navy);
    background: white;
    box-shadow: 0 2px 12px rgba(37,60,116,.12);
}
.mlpb-option input[type="radio"] { display: none; }
.mlpb-option__icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.mlpb-option__text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--mlpb-gray-800);
    line-height: 1.4;
}
.mlpb-option__check {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--mlpb-gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    color: white;
    transition: all .2s;
    flex-shrink: 0;
}
.mlpb-option.selected .mlpb-option__check {
    background: var(--mlpb-navy);
    border-color: var(--mlpb-navy);
}
.mlpb-option--other {
    border-style: dashed;
}

/* ─── Other input ─── */
.mlpb-other-input { padding: 0 0 8px 0; }
.mlpb-other-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--mlpb-blue);
    border-radius: 8px;
    font-family: var(--mlpb-font);
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}
.mlpb-other-textarea:focus { box-shadow: 0 0 0 3px rgba(12,77,162,.15); }

/* ─── Nav ─── */
.mlpb-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* ─── Buttons ─── */
.mlpb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--mlpb-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
    text-decoration: none;
}
.mlpb-btn:disabled { opacity: .4; cursor: not-allowed; }
.mlpb-btn--next, .mlpb-btn--primary, .mlpb-btn--generate {
    background: var(--mlpb-navy);
    color: white;
}
.mlpb-btn--next:hover:not(:disabled),
.mlpb-btn--primary:hover:not(:disabled),
.mlpb-btn--generate:hover:not(:disabled) {
    background: var(--mlpb-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,60,116,.25);
}
.mlpb-btn--ghost {
    background: transparent;
    border-color: var(--mlpb-gray-200);
    color: var(--mlpb-gray-600);
}
.mlpb-btn--ghost:hover {
    border-color: var(--mlpb-navy);
    color: var(--mlpb-navy);
}
.mlpb-btn--copy {
    background: var(--mlpb-pink);
    color: white;
    border-color: var(--mlpb-pink);
    flex: 1;
}
.mlpb-btn--copy:hover {
    background: #d42f87;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(238,56,151,.3);
}

/* ─── Spinner ─── */
.mlpb-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: mlpb-spin .7s linear infinite;
}
@keyframes mlpb-spin { to { transform: rotate(360deg); } }

/* ─── Name screen ─── */
.mlpb-text-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--mlpb-gray-200);
    border-radius: 10px;
    font-family: var(--mlpb-font);
    font-size: 16px;
    margin-bottom: 24px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
}
.mlpb-text-input:focus { border-color: var(--mlpb-navy); }

/* ─── Result screen ─── */
.mlpb-screen--result .mlpb-result-header {
    margin-bottom: 20px;
}
.mlpb-screen--result h2 {
    font-size: 22px; font-weight: 700;
    color: var(--mlpb-navy); margin: 0 0 6px;
}
.mlpb-result-sub { color: var(--mlpb-gray-600); font-size: 14px; margin: 0; }

.mlpb-post-output-wrap {
    border: 2px solid var(--mlpb-gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--mlpb-gray-50);
}
.mlpb-post-output {
    padding: 20px 22px;
    min-height: 150px;
    font-size: 15px;
    line-height: 1.65;
    white-space: pre-wrap;
    outline: none;
    color: var(--mlpb-gray-800);
}
.mlpb-post-output:focus { background: white; }
.mlpb-char-count {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--mlpb-gray-400);
    border-top: 1px solid var(--mlpb-gray-200);
    background: white;
    text-align: right;
}
.mlpb-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.mlpb-feedback-panel {
    background: var(--mlpb-gray-50);
    border: 2px solid var(--mlpb-gray-200);
    border-radius: 10px;
    padding: 20px;
    margin-top: 12px;
}
.mlpb-feedback-panel h3 { margin: 0 0 12px; font-size: 16px; color: var(--mlpb-navy); }
.mlpb-feedback-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--mlpb-gray-200);
    border-radius: 8px;
    font-family: var(--mlpb-font);
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 14px;
}
.mlpb-feedback-textarea:focus { border-color: var(--mlpb-navy); }
.mlpb-feedback-actions { display: flex; gap: 10px; }
.mlpb-copy-success {
    background: #f0fdf4;
    border: 2px solid #86efac;
    color: #166534;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
}

/* ─── Disclaimer ─── */
.mlpb-disclaimer {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 20px;
}
.mlpb-disclaimer strong {
    color: #b45309;
}
.mlpb-disclaimer a {
    color: var(--mlpb-navy);
    font-weight: 600;
    text-decoration: none;
}
.mlpb-disclaimer a:hover {
    text-decoration: underline;
    color: var(--mlpb-pink);
}

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .mlpb-screen__inner { padding: 24px 20px 20px; }
    .mlpb-q-text { font-size: 18px; }
    .mlpb-progress__header { flex-direction: column; gap: 12px; }
    .mlpb-result-actions { flex-direction: column; }
    .mlpb-btn--copy { flex: unset; }
    .mlpb-step-dot { width: 26px; height: 26px; font-size: 10px; }
}

/* ─── Loading overlay ─── */
.mlpb-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.mlpb-loading-overlay__spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--mlpb-gray-200);
    border-top-color: var(--mlpb-navy);
    border-radius: 50%;
    animation: mlpb-spin .8s linear infinite;
}
.mlpb-loading-overlay__text {
    font-family: var(--mlpb-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--mlpb-navy);
}
.mlpb-loading-overlay__sub {
    font-size: 12px;
    color: var(--mlpb-gray-400);
}

/* ─── Progress Loading Box ─── */
.mlpb-loading-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(37,60,116,.2);
    padding: 32px 36px;
    max-width: 420px;
    width: 90%;
}
.mlpb-loading-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--mlpb-gray-100);
}
.mlpb-loading-header .mlpb-loading-overlay__spinner {
    width: 36px; height: 36px;
    border-width: 3px;
    flex-shrink: 0;
}
.mlpb-loading-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mlpb-navy);
}

/* ─── Progress Steps ─── */
.mlpb-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.mlpb-progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--mlpb-gray-50);
    transition: all .3s ease;
}
.mlpb-progress-step.active {
    background: linear-gradient(135deg, rgba(37,60,116,.08), rgba(238,56,151,.06));
    border: 1px solid rgba(37,60,116,.15);
}
.mlpb-progress-step.done {
    background: #f0fdf4;
    border: 1px solid #86efac;
}
.mlpb-progress-step.pending {
    opacity: .5;
}
.mlpb-progress-step__icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.mlpb-progress-step__text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--mlpb-gray-600);
    line-height: 1.4;
}
.mlpb-progress-step.active .mlpb-progress-step__text {
    color: var(--mlpb-navy);
    font-weight: 600;
}
.mlpb-progress-step.done .mlpb-progress-step__text {
    color: #166534;
}
.mlpb-progress-step__status {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.mlpb-step-pending, .mlpb-step-active, .mlpb-step-done { display: none; }
.mlpb-progress-step.pending .mlpb-step-pending { display: inline; color: var(--mlpb-gray-400); }
.mlpb-progress-step.active .mlpb-step-active { display: inline-flex; }
.mlpb-progress-step.done .mlpb-step-done { display: inline; color: #16a34a; font-weight: 700; }

.mlpb-spinner--sm {
    width: 14px; height: 14px;
    border-width: 2px;
}

/* ─── Progress Bar Mini ─── */
.mlpb-loading-footer {
    text-align: center;
}
.mlpb-progress-bar-mini {
    height: 6px;
    background: var(--mlpb-gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}
.mlpb-progress-bar-mini__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mlpb-navy), var(--mlpb-pink));
    border-radius: 3px;
    transition: width .5s ease;
    width: 0%;
}
.mlpb-loading-sub {
    font-size: 12px;
    color: var(--mlpb-gray-400);
}
