/* ================================================================
   Baby Name Combination Tool — Mobile-First Stylesheet
   Strictly compliant with Naam Hi Naam Brand Tokens & WCAG AA
   ================================================================ */

/* ── Wrap ── */
.bnc-wrap {
    font-family: var(--font-body, 'Inter', sans-serif);
    padding: 0;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--ink, #1C1B29);
}

/* ── Card ── */
.bnc-card {
    background: var(--surface, #fff);
    border-radius: 24px;
    padding: 24px 20px 32px;
    box-shadow: var(--shadow-lg, 0 4px 20px rgba(0, 0, 0, .06));
    border: 1px solid var(--border, #E9E7F0);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.bnc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
    background-size: 200% 100%;
    animation: bncGradShift 4s linear infinite;
}

@keyframes bncGradShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* ── Card Header ── */
.bnc-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.bnc-icon-badge {
    width: 60px;
    height: 60px;
    background: var(--brand-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(var(--brand-primary-rgb, 217, 0, 107), .35);
}

.bnc-title {
    font-family: var(--font-display, 'Sora', sans-serif);
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 800;
    margin: 0 0 8px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.bnc-subtitle {
    font-size: 14px;
    color: var(--ink-soft, #6B6878);
    line-height: 1.6;
    margin: 0;
    max-width: 500px;
    margin-inline: auto;
}

/* ── Form ── */
.bnc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bnc-fields-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bnc-field-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bnc-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink, #1C1B29);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.bnc-label .fa-mars {
    color: var(--brand-secondary, #1A47E7);
}

.bnc-label .fa-venus {
    color: var(--brand-primary, #D9006B);
}

.bnc-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border, #E9E7F0);
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--ink, #1C1B29);
    background: var(--canvas, #FAFAFC);
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.bnc-input::placeholder {
    color: var(--ink-faint, #9A96A8);
}

.bnc-input:focus {
    outline: none;
    border-color: var(--brand-primary, #D9006B);
    background: var(--surface, #fff);
    box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb, 217, 0, 107), .12);
}

.bnc-error {
    font-size: 12px;
    color: #ef4444;
    font-weight: 600;
    min-height: 16px;
    display: block;
}

/* Plus divider */
.bnc-plus-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bnc-plus-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary-soft, #FDF0F6), var(--brand-secondary-soft, #EEF2FE));
    border: 2px solid var(--brand-primary-tint, #FCE7F1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--brand-primary, #D9006B);
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Submit Button ── */
.bnc-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(var(--brand-primary-rgb, 217, 0, 107), .35);
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.bnc-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--brand-gradient-hover);
    box-shadow: 0 8px 28px rgba(var(--brand-primary-rgb, 217, 0, 107), .45);
}

.bnc-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bnc-submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.bnc-btn-loading {
    display: none;
}

.bnc-submit-btn.is-loading .bnc-btn-text {
    display: none;
}

.bnc-submit-btn.is-loading .bnc-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bnc-submit-btn:focus-visible {
    outline: 3px solid var(--brand-primary, #D9006B);
    outline-offset: 2px;
}

/* ── Results ── */
.bnc-results {
    margin-top: 28px;
    border-top: 1px solid var(--border, #E9E7F0);
    padding-top: 24px;
}

.bnc-results-header {
    margin-bottom: 16px;
}

.bnc-results-title {
    font-family: var(--font-display, 'Sora', sans-serif);
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 800;
    color: var(--ink, #1C1B29);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bnc-results-title .fa-stars,
.bnc-results-title .fa-star {
    color: var(--marigold, #F2A93B);
}

.bnc-results-sub {
    font-size: 13px;
    color: var(--ink-soft, #6B6878);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bnc-legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* ── Results Grid ── */
.bnc-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ── Name Card ── */
.bnc-name-card {
    background: var(--canvas, #FAFAFC);
    border: 1.5px solid var(--border, #E9E7F0);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bnc-name-card:hover {
    border-color: var(--brand-primary-tint, #FCE7F1);
    box-shadow: 0 4px 16px rgba(var(--brand-primary-rgb, 217, 0, 107), .1);
}

.bnc-name-card--match {
    background: linear-gradient(135deg, var(--brand-primary-soft, #FDF0F6) 0%, var(--surface, #ffffff) 100%);
    border-color: var(--brand-primary-tint, #FCE7F1);
    box-shadow: 0 2px 12px rgba(var(--brand-primary-rgb, 217, 0, 107), .08);
}

/* Badges */
.bnc-db-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
    letter-spacing: .02em;
}

.bnc-new-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--brand-secondary-soft, #EEF2FE);
    color: var(--brand-secondary, #1A47E7);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
    letter-spacing: .02em;
}

/* Name */
.bnc-name-link,
.bnc-name-text {
    font-family: var(--font-display, 'Sora', sans-serif);
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 800;
    color: var(--ink, #1C1B29);
    line-height: 1.1;
}

.bnc-name-link {
    color: var(--brand-primary, #D9006B);
    text-decoration: none;
    transition: color .2s;
}

.bnc-name-link:hover {
    color: var(--brand-primary-hover, #BA005A);
    text-decoration: underline;
}

/* Gender tag */
.bnc-gender {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    align-self: flex-start;
}

.bnc-gender--boy {
    background: #dbeafe;
    color: #1e40af;
}

.bnc-gender--girl {
    background: var(--brand-primary-soft, #FDF0F6);
    color: var(--brand-primary, #D9006B);
}

/* Meaning */
.bnc-meaning {
    font-size: 13px;
    color: var(--ink-soft, #6B6878);
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* Match Bar */
.bnc-match-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bnc-match-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--border, #E9E7F0);
    border-radius: 99px;
    overflow: hidden;
}

.bnc-match-bar {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 99px;
    transition: width .8s cubic-bezier(.16, 1, .3, 1);
}

.bnc-match-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-primary, #D9006B);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* View Details Button */
.bnc-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--btn-view-details-bg, var(--brand-gradient));
    color: var(--btn-view-details-color, #fff);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-pill, 50px);
    align-self: flex-start;
    transition: transform .15s ease, box-shadow .15s ease, gap .15s ease;
    min-height: 36px;
    box-shadow: 0 2px 8px rgba(var(--brand-primary-rgb, 217, 0, 107), .25);
    border: none;
}

.bnc-view-btn:hover {
    transform: translateY(-1px);
    background: var(--btn-view-details-hover-bg, var(--brand-gradient-hover));
    box-shadow: 0 4px 14px rgba(var(--brand-primary-rgb, 217, 0, 107), .35);
    color: var(--btn-view-details-hover-color, #fff);
    text-decoration: none;
    gap: 9px;
}

/* Skeleton loading */
.bnc-skeleton-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.bnc-skeleton-card {
    height: 120px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e9eef4 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: bnc-shimmer 1.4s ease infinite;
    border-radius: 16px;
}

@keyframes bnc-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* No results / error */
.bnc-no-results,
.bnc-error-msg {
    text-align: center;
    padding: 24px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.bnc-no-results {
    background: var(--canvas, #FAFAFC);
    color: var(--ink-soft, #6B6878);
}

.bnc-error-msg {
    background: #fef2f2;
    color: #dc2626;
}

/* ── Results Actions ── */
.bnc-results-actions {
    margin-top: 20px;
    text-align: center;
}

.bnc-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--canvas, #FAFAFC);
    color: var(--ink-soft, #6B6878);
    border: 1.5px solid var(--border, #E9E7F0);
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, color .2s;
    min-height: 44px;
}

.bnc-reset-btn:hover {
    background: var(--border, #E9E7F0);
    color: var(--ink, #1C1B29);
}

.bnc-reset-btn:focus-visible {
    outline: 3px solid var(--brand-primary, #D9006B);
    outline-offset: 2px;
}

/* ── How It Works Section ── */
.bnc-info-section,
.bnc-faq-section {
    margin-bottom: 24px;
}

.bnc-section-title {
    font-family: var(--font-display, 'Sora', sans-serif);
    font-size: clamp(17px, 3.5vw, 22px);
    font-weight: 800;
    color: var(--ink, #1C1B29);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bnc-section-title .fas {
    color: var(--brand-primary, #D9006B);
}

.bnc-how-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.bnc-how-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #E9E7F0);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow, 0 1px 8px rgba(0, 0, 0, .04));
}

.bnc-how-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-primary-soft, #FDF0F6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--brand-primary, #D9006B);
    margin-bottom: 12px;
}

.bnc-how-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--ink, #1C1B29);
}

.bnc-how-card p {
    font-size: 13.5px;
    color: var(--ink-soft, #6B6878);
    line-height: 1.6;
    margin: 0;
}

/* ── FAQ ── */
.bnc-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bnc-faq-item {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #E9E7F0);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .2s;
}

.bnc-faq-item[open] {
    box-shadow: 0 4px 20px rgba(var(--brand-primary-rgb, 217, 0, 107), .08);
    border-color: var(--brand-primary-tint, #FCE7F1);
}

.bnc-faq-q {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink, #1C1B29);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: color .2s;
    min-height: 44px;
    user-select: none;
}

.bnc-faq-q::-webkit-details-marker {
    display: none;
}

.bnc-faq-q::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
    color: var(--brand-primary, #D9006B);
    transition: transform .3s;
    flex-shrink: 0;
}

.bnc-faq-item[open] .bnc-faq-q {
    color: var(--brand-primary, #D9006B);
}

.bnc-faq-item[open] .bnc-faq-q::after {
    transform: rotate(180deg);
}

.bnc-faq-a {
    padding: 0 20px 16px;
    border-top: 1px solid var(--border, #E9E7F0);
}

.bnc-faq-a p {
    font-size: 13.5px;
    color: var(--ink-soft, #6B6878);
    line-height: 1.7;
    margin: 12px 0 0;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .bnc-submit-btn,
    .bnc-view-btn,
    .bnc-reset-btn,
    .bnc-name-card,
    .bnc-match-bar {
        transition: none;
    }

    .bnc-skeleton-card {
        animation: none;
        background: #e9eef4;
    }
}

/* ── Tablet: 600px+ ── */
@media (min-width: 600px) {
    .bnc-card {
        padding: 32px;
    }

    .bnc-fields-row {
        flex-direction: row;
        align-items: flex-start;
        gap: 16px;
    }

    .bnc-plus-divider {
        margin-top: 36px;
    }

    .bnc-submit-btn {
        width: auto;
        align-self: center;
        padding: 16px 36px;
    }

    .bnc-form {
        align-items: stretch;
    }

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

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

    .bnc-how-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Desktop: 900px+ ── */
@media (min-width: 900px) {
    .bnc-card {
        padding: 40px;
    }

    .bnc-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bnc-skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}