/**
 * Megify Business Name Generator Styles
 * Hero landing + Wizard UI
 */

/* ─── Container ─── */
.megify-bng-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    position: relative;
}

/* ─── Step 1: Hero Landing ─── */
.bng-hero {
    position: relative;
    padding: 4rem 2rem 3rem;
    overflow: hidden;
}

/* Grid background pattern */
.bng-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Cross marks at grid intersections */
.bng-hero-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(99, 102, 241, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: 0 0;
    pointer-events: none;
}

/* Fade edges of grid */
.bng-hero-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, transparent 75%);
    pointer-events: none;
}

.bng-hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

/* Typing tagline */
.bng-hero-tagline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    color: #374151;
    min-height: 1.5em;
}

.bng-sparkle-icon {
    flex-shrink: 0;
}

.bng-typing-text {
    font-weight: 500;
}

.bng-typing-cursor {
    font-weight: 300;
    color: #6366f1;
    animation: bngBlink 0.8s infinite;
}

@keyframes bngBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Main headline */
.bng-hero-headline {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff !important;
    margin: 0 0 1rem 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Subtitle */
.bng-hero-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 auto 2.5rem !important;
    max-width: 520px;
    line-height: 1.6;
    text-align: center;
}

/* ─── Search Bar ─── */
.bng-searchbar {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.bng-searchbar-inner {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s, border-color 0.3s;
    gap: 0.75rem;
    min-height: 72px;
}

.bng-searchbar-inner:focus-within {
    border-color: #6366f1;
    box-shadow: 0 4px 32px rgba(99, 102, 241, 0.12), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.bng-searchbar-icon {
    flex-shrink: 0;
    opacity: 0.5;
}

.bng-searchbar-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.0625rem;
    font-family: inherit;
    color: #1a1a2e;
    background: transparent;
    min-width: 0;
    padding: 0.75rem 0;
    align-self: center;
}

.bng-searchbar-input::placeholder {
    color: #9ca3af;
}

.bng-searchbar-btn {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #6366f1;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    flex-shrink: 0;
}

.bng-searchbar-btn:hover:not(:disabled) {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.bng-searchbar-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Gradient accent line under search bar */
.bng-searchbar-accent {
    height: 3px;
    margin: 0 2rem;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent);
    opacity: 0.4;
}

/* Expand area (hidden textarea for fallback) */
.bng-expand-area {
    max-width: 600px;
    margin: 1rem auto 0;
}

.bng-expand-area .bng-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 1rem;
}

/* ─── Progress Bar ─── */
.bng-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 1rem 0;
}

.bng-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    z-index: 1;
}

.bng-progress-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.bng-progress-step.active .step-number {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
}

.bng-progress-step.completed .step-number {
    background: #10b981;
    color: #fff;
}

.bng-progress-step .step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.bng-progress-step.active .step-label {
    color: #6366f1;
}

.bng-progress-step.completed .step-label {
    color: #10b981;
}

.bng-progress-line {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
    margin-bottom: 1.25rem;
    border-radius: 2px;
    transition: background 0.3s ease;
    max-width: 120px;
}

.bng-progress-line.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* ─── Step Header (steps 2-3) ─── */
.bng-step-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.bng-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
}

.bng-subtitle {
    color: #6b7280;
    margin: 0 auto !important;
    font-size: 1rem;
    max-width: 520px;
    line-height: 1.6;
    text-align: center;
}

/* ─── Textarea (fallback) ─── */
.bng-textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
}

.bng-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.bng-textarea::placeholder {
    color: #9ca3af;
}

.bng-char-count {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* ─── Buttons ─── */
.bng-generate-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.bng-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.bng-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bng-regenerate-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #6366f1;
    background: transparent;
    border: 2px solid #6366f1;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
}

.bng-regenerate-btn:hover:not(:disabled) {
    background: #f5f3ff;
}

.bng-regenerate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bng-select-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.bng-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.bng-btn-icon {
    flex-shrink: 0;
}

/* ─── Step 2: Names List ─── */
.bng-names-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 560px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

.bng-name-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
    animation: bngSlideIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(12px);
}

.bng-name-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
}

@keyframes bngSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bng-name-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
    margin-right: 1rem;
}

.bng-name-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
}

.bng-name-tagline {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

.bng-step-actions {
    display: flex;
    justify-content: center;
}

/* ─── Step 3: Brand Kit ─── */
.bng-brandkit {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.bk-name-banner {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: #1a1a2e;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 2px solid #c4b5fd;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.bk-section {
    margin-bottom: 1.75rem;
}

.bk-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.bk-section-title svg {
    color: #6366f1;
    flex-shrink: 0;
}

.bk-typography {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.bk-font-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.bk-font-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bk-font-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a2e;
}

.bk-font-preview {
    font-size: 1.5rem;
    color: #374151;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.bk-font-heading { font-weight: 700; }
.bk-font-body { font-weight: 400; }

.bk-note {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    margin: 0.75rem 0 0 0;
    line-height: 1.5;
}

.bk-colors {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bk-color-card {
    flex: 1;
    min-width: 90px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    animation: bngSlideIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(8px);
}

.bk-color-card:nth-child(1) { animation-delay: 0s; }
.bk-color-card:nth-child(2) { animation-delay: 0.05s; }
.bk-color-card:nth-child(3) { animation-delay: 0.1s; }
.bk-color-card:nth-child(4) { animation-delay: 0.15s; }
.bk-color-card:nth-child(5) { animation-delay: 0.2s; }

.bk-color-swatch {
    width: 100%;
    height: 56px;
}

.bk-color-info {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.bk-color-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a2e;
}

.bk-color-hex {
    font-size: 0.6875rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #6b7280;
}

.bk-color-usage {
    font-size: 0.6875rem;
    color: #9ca3af;
    line-height: 1.3;
}

.bk-logo-card {
    padding: 1.25rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.bk-logo-row {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.5;
}

.bk-logo-row strong {
    color: #1a1a2e;
}

.bk-logo-concept {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.6;
    padding: 0.75rem;
    background: #fff;
    border-left: 3px solid #6366f1;
    border-radius: 0 8px 8px 0;
}

/* ─── CTA ─── */
.bng-cta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
}

.bng-cta-desc {
    color: #6b7280;
    text-align: center;
    max-width: 480px;
    line-height: 1.6;
    margin: 0;
}

.bng-cta-link {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
    font-family: inherit;
}

.bng-cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    color: #fff !important;
}

.bng-restart-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: underline;
    font-family: inherit;
}

.bng-restart-btn:hover {
    color: #6366f1;
}

/* ─── Loading Overlay ─── */
.bng-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.bng-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: bngSpin 0.8s linear infinite;
}

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

.bng-loading-text {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

/* ─── Logo Image ─── */
.bk-logo-image-wrapper {
    text-align: center;
    margin-bottom: 1rem;
}

.bk-logo-image {
    max-width: 220px;
    height: auto;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    animation: bngSlideIn 0.5s ease forwards;
}

.bk-logo-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.bk-mini-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: bngSpin 0.8s linear infinite;
    flex-shrink: 0;
}

.bk-logo-loading-text {
    color: #6b7280;
    font-size: 0.9375rem;
}

.bk-logo-error {
    color: #9ca3af;
    font-size: 0.875rem;
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* ─── Error Message ─── */
.bng-error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    color: #dc2626;
    margin: 1rem auto;
    max-width: 560px;
    font-size: 0.9375rem;
    animation: bngSlideIn 0.3s ease forwards;
}

/* ─── Steps 2-3 White Card ─── */
.bng-step-2,
.bng-step-3 {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    max-width: 760px;
    margin: 0 auto;
}

/* ─── Step Transitions ─── */
.bng-step {
    transition: opacity 0.3s ease;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .bng-hero {
        padding: 2.5rem 1rem 2rem;
    }

    .bng-hero-headline {
        font-size: 2.25rem;
    }

    .bng-hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .bng-hero-tagline {
        font-size: 0.8125rem;
    }

    .bng-searchbar-inner {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .bng-searchbar-icon {
        display: none;
    }

    .bng-searchbar-input {
        width: 100%;
        text-align: center;
    }

    .bng-searchbar-btn {
        width: 100%;
        padding: 0.75rem;
    }

    .bng-searchbar-accent {
        margin: 0 1rem;
    }

    .bng-title {
        font-size: 1.375rem;
    }

    .bng-subtitle {
        font-size: 0.9375rem;
    }

    .bng-name-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .bng-name-info {
        margin-right: 0;
    }

    .bng-name-card .bng-select-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .bk-name-banner {
        font-size: 1.5rem;
        padding: 1rem;
    }

    .bk-typography {
        grid-template-columns: 1fr;
    }

    .bk-color-card {
        min-width: 70px;
    }

    .bk-color-swatch {
        height: 44px;
    }

    .bng-progress-step .step-label {
        font-size: 0.6875rem;
    }

    .bng-progress-step .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    .bng-cta-link {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}
