/* ============================================================
   instagram-bio-generator.css
   tools.dotiam.com
   ============================================================ */

:root {
    --ibg-grad1: #f09433;
    --ibg-grad2: #e6683c;
    --ibg-grad3: #dc2743;
    --ibg-grad4: #cc2366;
    --ibg-grad5: #bc1888;
    --ibg-purple: #7c3aed;
    --ibg-pink:   #ec4899;
    --ibg-bg:     #faf7ff;
    --ibg-card:   #ffffff;
    --ibg-border: #ede9fe;
    --ibg-text:   #1e1b4b;
    --ibg-muted:  #6b7280;
    --ibg-green:  #10b981;
}

/* Header gradient — Instagram style */
.ibg-header {
    background: linear-gradient(135deg, var(--ibg-grad1), var(--ibg-grad2), var(--ibg-grad3), var(--ibg-grad4), var(--ibg-grad5)) !important;
}

/* ── Wrap ── */
.ibg-wrap {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Form Card ── */
.ibg-form {
    background: var(--ibg-card);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 30px rgba(124,58,237,.08);
    border: 1.5px solid var(--ibg-border);
}

.ibg-form-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ibg-text);
    margin: 0 0 24px;
}

/* ── Fields ── */
.ibg-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.ibg-field label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    color: var(--ibg-text);
    margin-bottom: 8px;
}

.ibg-field label small {
    font-weight: 400;
    color: var(--ibg-muted);
    font-size: .8rem;
}

.ibg-field input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--ibg-border);
    border-radius: 12px;
    font-size: .9rem;
    color: var(--ibg-text);
    background: #fafafa;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.ibg-field input[type="text"]:focus {
    border-color: var(--ibg-purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
    background: #fff;
}

/* ── Chips ── */
.ibg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: #f5f3ff;
    color: var(--ibg-purple);
    border: 1.5px solid #ddd6fe;
    border-radius: 30px;
    padding: 7px 15px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--ibg-purple);
    background: #ede9fe;
}

.chip.active {
    background: linear-gradient(135deg, var(--ibg-purple), var(--ibg-pink));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(124,58,237,.3);
}

/* ── Toggle ── */
.ibg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ibg-toggle-row label:first-child {
    margin-bottom: 0;
}

.ibg-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.ibg-toggle input { opacity: 0; width: 0; height: 0; }

.ibg-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 30px;
    cursor: pointer;
    transition: background .2s;
}

.ibg-slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.ibg-toggle input:checked + .ibg-slider {
    background: linear-gradient(135deg, var(--ibg-purple), var(--ibg-pink));
}

.ibg-toggle input:checked + .ibg-slider::before {
    transform: translateX(22px);
}

/* ── Generate Button ── */
.ibg-generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--ibg-grad1), var(--ibg-grad3), var(--ibg-grad5));
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity .2s, transform .15s;
    box-shadow: 0 4px 20px rgba(220,39,67,.3);
}

.ibg-generate-btn:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
}

.ibg-generate-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-icon { font-size: 1.2rem; }

/* ── Loading ── */
.ibg-loading {
    text-align: center;
    padding: 40px;
    background: var(--ibg-card);
    border-radius: 20px;
    border: 1.5px solid var(--ibg-border);
}

.ibg-spinner {
    width: 44px; height: 44px;
    border: 4px solid #ede9fe;
    border-top-color: var(--ibg-purple);
    border-radius: 50%;
    animation: ibgSpin .7s linear infinite;
    margin: 0 auto 16px;
}

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

.ibg-loading p {
    color: var(--ibg-muted);
    font-size: .9rem;
    margin: 0;
}

/* ── Error ── */
.ibg-error {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: 14px;
    padding: 16px 20px;
    text-align: center;
}

.ibg-error p {
    color: #dc2626;
    margin: 0;
    font-weight: 600;
}

/* ── Results ── */
.ibg-results {
    background: var(--ibg-card);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 30px rgba(124,58,237,.08);
    border: 1.5px solid var(--ibg-border);
}

.ibg-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.ibg-results-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ibg-text);
    margin: 0;
}

.ibg-regenerate {
    background: #f5f3ff;
    color: var(--ibg-purple);
    border: 1.5px solid #ddd6fe;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.ibg-regenerate:hover {
    background: #ede9fe;
    border-color: var(--ibg-purple);
}

/* ── Bio Cards ── */
.ibg-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ibg-card {
    background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 100%);
    border: 1.5px solid #e9d5ff;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow .2s, border-color .2s;
    position: relative;
}

.ibg-card:hover {
    border-color: var(--ibg-purple);
    box-shadow: 0 4px 16px rgba(124,58,237,.12);
}

.ibg-card-num {
    background: linear-gradient(135deg, var(--ibg-purple), var(--ibg-pink));
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ibg-card-body {
    flex: 1;
}

.ibg-card-text {
    font-size: .95rem;
    color: var(--ibg-text);
    line-height: 1.6;
    margin: 0 0 10px;
    font-weight: 500;
    white-space: pre-line;
}

.ibg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.ibg-char-count {
    font-size: .75rem;
    color: var(--ibg-muted);
}

.ibg-char-count span {
    font-weight: 700;
    color: var(--ibg-purple);
}

.ibg-char-count.over span { color: #dc2626; }

.ibg-copy-btn {
    background: var(--ibg-purple);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ibg-copy-btn:hover { opacity: .85; }

.ibg-copy-btn.copied {
    background: var(--ibg-green);
}

/* ── How It Works ── */
.ibg-how {
    background: var(--ibg-card);
    border-radius: 20px;
    padding: 28px;
    border: 1.5px solid var(--ibg-border);
}

.ibg-how h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ibg-text);
    margin: 0 0 20px;
}

.ibg-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ibg-step {
    text-align: center;
}

.step-num {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--ibg-purple), var(--ibg-pink));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.ibg-step p {
    font-size: .82rem;
    color: var(--ibg-muted);
    margin: 0;
    line-height: 1.4;
}

/* ── Tips ── */
.ibg-tips {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 20px;
    padding: 24px 28px;
}

.ibg-tips h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #065f46;
    margin: 0 0 14px;
}

.ibg-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ibg-tips ul li {
    font-size: .87rem;
    color: #047857;
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .ibg-form, .ibg-results, .ibg-how, .ibg-tips {
        padding: 20px 16px;
    }

    .ibg-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .ibg-card { flex-direction: column; gap: 10px; }

    .ibg-card-num { align-self: flex-start; }

    .chip { font-size: .78rem; padding: 6px 12px; }
}

@media (max-width: 380px) {
    .ibg-steps { grid-template-columns: 1fr 1fr; }
    .ibg-card-footer { flex-direction: column; align-items: flex-start; }
}