/**
 * Instagram Mockup Generators — shared studio styles
 * Powers: Instagram Post / Profile / Post Modal generators.
 * Flat, high-contrast CreatorFlow brand: borders for elevation, NO box-shadows
 * on site chrome, lime (#d1fe17) used sparingly. The mockup's own subtle shadow
 * is drawn inside the <canvas> as artwork (the product output), not via CSS.
 */

/* ── Studio layout ─────────────────────────────────────────────── */
.mg-studio {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
    gap: 1.5rem;
    align-items: start;
    max-width: 1040px;
    margin: 0 auto;
}

/* ── Controls panel ────────────────────────────────────────────── */
.mg-panel {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    padding: 1.5rem;
}

.mg-field {
    margin-bottom: 1.15rem;
}
.mg-field:last-child {
    margin-bottom: 0;
}

.mg-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.mg-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.mg-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.45rem;
}

.mg-subhead {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin: 1.5rem 0 0.85rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
}
.mg-subhead:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.mg-input,
.mg-textarea,
.mg-select {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.mg-textarea {
    resize: vertical;
    min-height: 78px;
    line-height: 1.5;
}
.mg-input::placeholder,
.mg-textarea::placeholder {
    color: #9ca3af;
}
.mg-input:focus,
.mg-textarea:focus,
.mg-select:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

/* Select with chevron */
.mg-select-wrap {
    position: relative;
}
.mg-select {
    padding-right: 2.25rem;
    cursor: pointer;
}
.mg-select-wrap::after {
    content: "";
    position: absolute;
    right: 0.95rem;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.mg-counter {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ── Upload tile (avatar + rectangular media) ──────────────────── */
.mg-upload-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.mg-thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}
.mg-thumb--rect {
    width: 54px;
    height: 54px;
    border-radius: 10px;
}
.mg-thumb:hover {
    border-color: #111827;
    color: #6b7280;
}
.mg-thumb__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mg-mini-btn {
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mg-mini-btn:hover {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}
.mg-or {
    font-size: 0.8rem;
    color: #9ca3af;
}
.mg-link-btn {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.25rem;
}
.mg-link-btn:hover {
    color: #111827;
}

/* Grid of small upload tiles (profile grid images) */
.mg-grid-uploads {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.mg-grid-uploads .mg-grid-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}
.mg-grid-uploads .mg-grid-tile:hover {
    border-color: #111827;
    color: #6b7280;
}
.mg-grid-uploads .mg-grid-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mg-grid-tile__num {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
}

/* ── Toggle switch (verified) ──────────────────────────────────── */
.mg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.mg-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 26px;
    cursor: pointer;
}
.mg-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.mg-switch__track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.15s ease;
}
.mg-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.15s ease;
}
.mg-switch input:checked + .mg-switch__track {
    background: #111827;
}
.mg-switch input:checked + .mg-switch__track::after {
    transform: translateX(18px);
}

/* ── Preview ───────────────────────────────────────────────────── */
.mg-preview {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    position: sticky;
    top: 1.5rem;
}
.mg-preview__bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}
.mg-ghost-btn {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mg-ghost-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.mg-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #000000;
    background: #d1fe17;
    border: 1px solid #d1fe17;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mg-download-btn:hover {
    background: #000000;
    border-color: #000000;
    color: #d1fe17;
}
.mg-download-btn svg {
    flex: 0 0 auto;
}

/* Stage: neutral checker so transparent PNG padding reads clearly */
.mg-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 2rem 1.5rem;
    background-color: #f9fafb;
    background-image:
        linear-gradient(45deg, #f0f1f3 25%, transparent 25%),
        linear-gradient(-45deg, #f0f1f3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f1f3 75%),
        linear-gradient(-45deg, transparent 75%, #f0f1f3 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    overflow: auto;
}
.mg-canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── CTA bridge ────────────────────────────────────────────────── */
.tool-section--bridge {
    padding-top: 0;
}
.tool-cta-bridge {
    margin: 0 auto;
    max-width: 720px;
    padding: 2rem;
    background: #000000;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.tool-cta-bridge__headline {
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    font-family: 'Clash Grotesk', sans-serif;
    font-weight: 600;
}
.tool-cta-bridge__lead {
    color: #d1d5db;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
.tool-cta-bridge__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.tool-cta-bridge__btn {
    display: inline-block;
    background: #d1fe17;
    color: #000000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}
.tool-cta-bridge__btn:hover {
    opacity: 0.9;
}
.tool-cta-bridge__btn--secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.tool-cta-bridge__note {
    display: block;
    margin-top: 0.75rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ── Info section: points / steps / use cases / limits ─────────── */
.mg-points {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}
.mg-point {
    border-left: 3px solid #d1fe17;
    padding: 0.25rem 0 0.25rem 1rem;
}
.mg-point__title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.3rem;
}
.mg-point__text {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.mg-steps {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
.mg-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.mg-step__num {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #d1fe17;
    color: #000000;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mg-step__title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111827;
    margin: 0.2rem 0 0.25rem;
}
.mg-step__text {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.55;
    margin: 0;
}

.mg-usecases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.mg-usecase {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    background: #ffffff;
}
.mg-usecase__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    margin-bottom: 0.6rem;
}
.mg-usecase__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.4rem;
}
.mg-usecase__text {
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.55;
    margin: 0;
}

.mg-limits {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}
.mg-limits li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    color: #6b7280;
    line-height: 1.55;
}
.mg-limits li::before {
    content: '!';
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    font-size: 0.7rem;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .mg-studio {
        grid-template-columns: 1fr;
    }
    .mg-preview {
        position: static;
        order: -1;
    }
}
@media (max-width: 420px) {
    .mg-grid-2 {
        grid-template-columns: 1fr;
    }
    .mg-stage {
        padding: 1.25rem 0.75rem;
        min-height: 320px;
    }
}
