/* =========================================================
   /css/community/major_fit.css  (FINAL / PRODUCTION)
   - Major Fit Survey UI (Depline)
   - Tablet/Mobile/Small-mobile optimized
   - Result: TOP3 only
   - Lead gate + privacy consent
   ========================================================= */

/* ------------------------------
   0) Tokens
------------------------------ */
:root {
    --bg: #ffffff;
    --ink: #0f172a;
    --muted: #475569;
    --muted2: #64748b;
    --line: rgba(15, 23, 42, .10);

    --card: #ffffff;
    --card2: #f8fafc;

    --brand: #006400;
    --brand2: #0b7a0b;
    --brandSoft: rgba(0, 100, 0, .10);
    --brandLine: rgba(0, 100, 0, .18);

    --shadow: 0 14px 40px rgba(2, 6, 23, .08);
    --shadow2: 0 10px 22px rgba(2, 6, 23, .10);

    --radius: 18px;
    --radius2: 24px;

    --container: 1100px;
    --gutter: 20px;

    --fs-base: 16px;
    --fs-sm: .92rem;
    --fs-xs: .86rem;
    --fs-h1: clamp(1.35rem, 2.6vw, 2.05rem);
    --fs-h2: clamp(1.05rem, 1.7vw, 1.22rem);
}

/* ------------------------------
   1) Base
------------------------------ */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-size: var(--fs-base);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

.fit-wrap {
    background: linear-gradient(180deg, #f6faf7 0%, #ffffff 55%, #ffffff 100%);
    padding: 52px 0 70px;
}

.fit-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ------------------------------
   2) Cards / Hero
------------------------------ */
.fit-hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 14px;
}

.fit-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    padding: 18px;
    backdrop-filter: blur(10px);
}

.fit-kicker {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-weight: 950;
    letter-spacing: .02em;
    color: var(--brand);
    font-size: var(--fs-xs);
    margin-bottom: 10px;
}

.fit-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(0, 100, 0, .12);
}

.fit-title {
    margin: 0 0 8px;
    font-size: var(--fs-h1);
    line-height: 1.18;
    letter-spacing: -.02em;
    color: var(--ink);
    font-weight: 950;
}

.fit-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: var(--fs-sm);
}

.fit-desc b {
    color: var(--ink);
}

/* ------------------------------
   3) Major preview mini cards
------------------------------ */
.majors-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 14px 0 0;
}

.major-mini {
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .88);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
}

.major-mini__media {
    position: relative;
    aspect-ratio: 16/9;
    background: #eef2f7;
}

.major-mini__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.major-mini__cap {
    padding: 10px 10px 11px;
}

.major-mini__name {
    margin: 0;
    font-weight: 950;
    font-size: .96rem;
    letter-spacing: -.01em;
}

.major-mini__sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.35;
}

/* ------------------------------
   4) Lead form (Contact)
------------------------------ */
.fit-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fit-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 100, 0, .08);
    border: 1px solid rgba(0, 100, 0, .18);
    color: var(--brand);
    border-radius: 999px;
    font-weight: 950;
    font-size: var(--fs-xs);
    width: fit-content;
}

.lead-form {
    margin-top: 0;
}

.lead-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.lead-field {
    display: block;
}

.lead-label {
    display: block;
    font-weight: 950;
    font-size: var(--fs-xs);
    color: var(--ink);
    margin: 0 0 6px;
}

.lead-input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .14);
    background: rgba(255, 255, 255, .92);
    border-radius: 14px;
    padding: 12px 12px;
    font-size: var(--fs-sm);
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.lead-input:focus {
    border-color: rgba(0, 100, 0, .35);
    box-shadow: 0 0 0 4px rgba(0, 100, 0, .10);
}

.lead-input::placeholder {
    color: rgba(71, 85, 105, .70);
}

.fit-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.55;
}

/* Privacy */
.privacy-box {
    margin-top: -2px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
}

.privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.privacy-check input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.privacy-check__text {
    font-weight: 900;
    font-size: 12px;
    line-height: 1.35;
    color: var(--ink);
}

.privacy-desc {
    margin: 8px 0 0;
    font-size: 11px;
    /* ✅ 작게 */
    line-height: 1.55;
    color: var(--muted2);
}

/* ------------------------------
   5) Survey Panel
------------------------------ */
.fit-panel {
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--line);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.fit-panel-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
}

.fit-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    flex: 1;
}

.fit-progress-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.fit-p-label {
    font-weight: 950;
    font-size: var(--fs-sm);
}

.fit-p-count {
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: 900;
}

.fit-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    overflow: hidden;
}

.fit-bar>i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand2) 100%);
    border-radius: 999px;
    transition: width .28s ease;
}

.fit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Buttons */
.btn {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, .16);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 950;
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(180deg, var(--brand) 0%, #045f04 100%);
    border-color: rgba(0, 100, 0, .35);
    color: #fff;
}

.btn-new {
    border-color: #006400;
    color: #000000;
}

.btn-ghost {
    background: transparent;
}

.fit-panel-body {
    padding: 16px;
}

/* gate alert */
.fit-alert {
    margin-top: 14px;
    border: 1px solid rgba(180, 83, 9, .25);
    background: linear-gradient(180deg, rgba(251, 191, 36, .20) 0%, rgba(255, 255, 255, 1) 70%);
    border-radius: 16px;
    padding: 12px 12px;
    color: #7c2d12;
    font-weight: 900;
    font-size: 13px;
    line-height: 1.45;
}

/* ------------------------------
   6) Steps / Options
------------------------------ */
.fit-step {
    display: none;
    animation: fadeUp .22s ease both;
}

.fit-step.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.fit-q-title {
    margin: 0 0 6px;
    font-size: var(--fs-h2);
    letter-spacing: -.01em;
    font-weight: 950;
}

.fit-q-desc {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

/* options grid */
.fit-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.fit-opt {
    position: relative;
    border: 1px solid rgba(15, 23, 42, .14);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-radius: 18px;
    padding: 12px;
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
    user-select: none;
    min-height: 78px;
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.fit-opt:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 100, 0, .30);
    box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
}

.fit-opt input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.fit-opt__media {
    width: 92px;
    flex: 0 0 92px;
    border-radius: 14px;
    overflow: hidden;
    background: #eef2f7;
    border: 1px solid rgba(15, 23, 42, .10);
}

.fit-opt__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fit-opt__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.fit-opt-title {
    font-weight: 950;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.fit-opt-sub {
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.4;
}

.fit-check {
    width: 20px;
    height: 20px;
    border-radius: 7px;
    border: 2px solid rgba(15, 23, 42, .20);
    margin-top: 2px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    transition: all .12s ease;
    background: #fff;
}

.fit-check i {
    width: 11px;
    height: 11px;
    background: transparent;
    border-radius: 3px;
    transition: all .12s ease;
}

.fit-opt.on {
    border-color: rgba(0, 100, 0, .35);
    background: linear-gradient(180deg, rgba(0, 100, 0, .08) 0%, rgba(0, 100, 0, .03) 100%);
}

.fit-opt.on .fit-check {
    border-color: rgba(0, 100, 0, .55);
    box-shadow: 0 0 0 4px rgba(0, 100, 0, .10);
}

.fit-opt.on .fit-check i {
    background: var(--brand);
}

.fit-footnote {
    margin-top: 12px;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.6;
}

/* ------------------------------
   7) Result (TOP3 only)
------------------------------ */
.fit-result {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius2);
    background: rgba(255, 255, 255, .95);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.result-head {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
}

.result-title {
    margin: 0 0 6px;
    font-weight: 950;
    letter-spacing: -.01em;
    font-size: clamp(1.1rem, 1.8vw, 1.32rem);
}

.result-desc {
    margin: 0;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

.result-desc b {
    color: var(--ink);
}

.top3-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Top3 card */
.top3-card {
    border: 1px solid rgba(0, 100, 0, .18);
    background: linear-gradient(180deg, rgba(0, 100, 0, .06) 0%, rgba(255, 255, 255, 1) 72%);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.top3-media {
    aspect-ratio: 16/10;
    background: #eef2f7;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.top3-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.top3-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top3-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    font-weight: 950;
    font-size: 12px;
    background: rgba(0, 100, 0, .10);
    border: 1px solid rgba(0, 100, 0, .18);
    color: var(--brand);
}

.top3-name {
    margin: 2px 0 0;
    font-weight: 950;
    font-size: 1.02rem;
    letter-spacing: -.01em;
}

.top3-sub {
    margin: 0;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.55;
}

.top3-why {
    margin-top: 4px;
    color: var(--ink);
    font-weight: 900;
    font-size: 12px;
    line-height: 1.45;
}

.result-actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-note {
    margin: 0;
    padding: 0 16px 16px;
    color: var(--muted2);
    font-size: 12px;
    line-height: 1.55;
}

/* ------------------------------
   8) Responsive
------------------------------ */
@media (max-width: 980px) {
    .fit-hero {
        grid-template-columns: 1fr;
    }

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

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

    .fit-opt__media {
        width: 86px;
        flex-basis: 86px;
    }

    .top3-grid {
        grid-template-columns: 1fr;
    }

    .fit-panel-head {
        padding: 14px 14px;
    }

    .fit-panel-body {
        padding: 14px;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: 16px;
    }

    .fit-wrap {
        padding: 40px 0 56px;
    }

    .fit-card {
        padding: 16px;
    }

    .fit-title {
        line-height: 1.16;
    }

    .fit-desc {
        font-size: .93rem;
    }

    .majors-preview {
        grid-template-columns: 1fr;
    }

    .fit-options {
        grid-template-columns: 1fr;
    }

    .fit-opt {
        padding: 12px;
    }

    .fit-opt__media {
        width: 84px;
        flex-basis: 84px;
    }

    .btn {
        padding: 10px 12px;
    }

    .privacy-desc {
        font-size: 10.5px;
    }
}

@media (max-width: 420px) {
    .fit-card {
        padding: 14px;
        border-radius: 20px;
    }

    .fit-panel {
        border-radius: 20px;
    }

    .fit-panel-head {
        padding: 12px;
    }

    .fit-panel-body {
        padding: 12px;
    }

    .fit-opt-title {
        font-size: .98rem;
    }

    .fit-opt-sub {
        font-size: .82rem;
    }

    .privacy-check__text {
        font-size: 11.5px;
    }
}

/* ------------------------------
   9) Reduced motion
------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .fit-step {
        animation: none;
    }

    .fit-bar>i {
        transition: none;
    }

    .btn,
    .fit-opt {
        transition: none;
    }
}