:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #68758a;
    --primary: #3157d5;
    --primary-dark: #203da8;
    --border: #dfe6f1;
    --soft: #eef3ff;
    --success: #12805c;
    --success-soft: #e6f8f0;
    --danger: #a12b2b;
    --danger-soft: #fff0f0;
    --shadow: 0 14px 36px rgba(32, 50, 85, .10);
    --d1: #3568e8;
    --d2: #e34f76;
    --d3: #14a67e;
    --d4: #f59b2f;
    --d5: #8256d8;
    --d6: #e85f9c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, "Noto Sans Tamil", Latha, Vijaya, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% 8%, rgba(91, 124, 250, .10), transparent 28%),
        radial-gradient(circle at 92% 92%, rgba(233, 95, 156, .08), transparent 28%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
}
.lang-ta { line-height: 1.65; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 32px auto 56px; }
.page-shell.narrow { width: min(760px, calc(100% - 32px)); }
.test-shell { width: min(1050px, calc(100% - 32px)); }
.card {
    background: rgba(255,255,255,.97);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.hero {
    background: linear-gradient(135deg, #173d9b, #416ee8 52%, #7457d6);
    color: #fff;
    border-radius: 26px;
    padding: 38px;
    margin-bottom: 20px;
    box-shadow: 0 18px 44px rgba(50, 72, 165, .24);
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
}
.hero::before { width: 190px; height: 190px; right: -60px; top: -75px; }
.hero::after { width: 120px; height: 120px; right: 90px; bottom: -75px; }
.hero h1 { margin: 6px 0 6px; font-size: clamp(30px, 5vw, 48px); line-height: 1.12; position: relative; z-index: 1; }
.hero p, .hero .eyebrow { position: relative; z-index: 1; }
.hero p { margin: 0; opacity: .94; font-size: 18px; }
.result-hero { text-align: center; }
.eyebrow { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .82; }
.lang-ta .eyebrow { text-transform: none; letter-spacing: .02em; }

h1, h2, h3 { line-height: 1.25; }
h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.language-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    border-top: 4px solid #8d62df;
}
.language-switch { display: flex; gap: 8px; background: #f1f3f9; padding: 5px; border-radius: 14px; }
.language-btn {
    text-decoration: none;
    color: var(--text);
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 800;
}
.language-btn.active { color: #fff; background: linear-gradient(135deg, #3157d5, #8158d8); box-shadow: 0 5px 14px rgba(72, 75, 190, .25); }
.accent-card { border-top: 5px solid #3157d5; }
.title-with-icon { display: flex; gap: 14px; align-items: flex-start; }
.title-with-icon h2 { margin-bottom: 5px; }
.title-with-icon p { margin-top: 0; }
.round-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(135deg, #e9efff, #f5eaff); font-size: 24px; flex: 0 0 auto; }

label { display: block; font-weight: 800; margin: 16px 0 7px; }
input[type="text"], input[type="tel"] {
    width: 100%;
    border: 1px solid #cfd8e7;
    border-radius: 13px;
    padding: 13px 14px;
    font-size: 16px;
    outline: none;
    background: #fff;
}
input[type="text"]:focus, input[type="tel"]:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(49,87,213,.11); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #3157d5, #5a71e8); color: #fff; box-shadow: 0 8px 18px rgba(49,87,213,.20); }
.btn.primary:hover { background: linear-gradient(135deg, #2648c0, #4a60d8); }
.btn.success { background: linear-gradient(135deg, #0f986c, #20b383); color: #fff; box-shadow: 0 8px 18px rgba(15,152,108,.22); }
.btn.secondary { background: #eef2f8; color: var(--text); }
.btn.full { width: 100%; margin-top: 22px; }

.info-box, .alert { border-radius: 13px; padding: 14px 16px; margin-top: 18px; }
.info-box { background: #eef4ff; color: #24427f; border: 1px solid #d8e3ff; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #ffd1d1; }
.response-legend { margin-top: 22px; }
.mini-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 9px; }
.mini-scale span { background: rgba(255,255,255,.75); padding: 8px; border-radius: 9px; font-size: 12px; text-align: center; }
.mini-scale b { display: block; color: var(--primary); font-size: 15px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.topbar h1 { margin: 4px 0; }
.test-topbar { border-top: 5px solid var(--primary); }
.test-status { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.progress-pill, .answered-pill { padding: 9px 13px; border-radius: 999px; font-weight: 900; white-space: nowrap; }
.progress-pill { background: #edf1ff; color: #2846b6; }
.answered-pill { background: #e9f8f1; color: #107452; }
.sticky-note { margin: 0 0 16px; }
.colorful-note { background: linear-gradient(90deg, #fff7df, #f9f0ff); color: #674b18; border-color: #f3dfab; }

.page-progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0 0 14px; }
.progress-step {
    background: #e7ebf2;
    border-radius: 12px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #778196;
    font-size: 12px;
    border: 1px solid #dde3ed;
}
.progress-step b { font-size: 16px; line-height: 1; }
.progress-step small { margin-top: 4px; }
.progress-step.done { background: #e7f7ef; color: #117353; border-color: #cdebdc; }
.progress-step.current { background: linear-gradient(135deg, #3157d5, #7558d8); color: white; border-color: transparent; box-shadow: 0 7px 18px rgba(70,75,190,.22); transform: translateY(-2px); }

.dimension-banner {
    color: #fff;
    border-radius: 20px;
    padding: 22px 24px;
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
    box-shadow: 0 13px 30px rgba(34, 51, 90, .14);
}
.dimension-banner h2 { margin: 3px 0 5px; font-size: clamp(22px, 3vw, 30px); }
.dimension-banner p { margin: 0; opacity: .94; }
.dimension-kicker { font-size: 12px; font-weight: 900; opacity: .86; text-transform: uppercase; letter-spacing: .05em; }
.lang-ta .dimension-kicker { text-transform: none; letter-spacing: 0; }
.dimension-icon { width: 58px; height: 58px; border-radius: 17px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 30px; flex: 0 0 auto; }
.dimension-1 { background: linear-gradient(135deg, #2458d3, #5d82f0); }
.dimension-2 { background: linear-gradient(135deg, #d93f68, #f17e98); }
.dimension-3 { background: linear-gradient(135deg, #0f9671, #3bc3a1); }
.dimension-4 { background: linear-gradient(135deg, #e68c1f, #f5b95a); }
.dimension-5 { background: linear-gradient(135deg, #7047c5, #a07ce4); }
.dimension-6 { background: linear-gradient(135deg, #d94f8d, #ef83b4); }

.question-card { margin-bottom: 14px; border-left-width: 5px; }
.dimension-border-1 { border-left-color: var(--d1); }
.dimension-border-2 { border-left-color: var(--d2); }
.dimension-border-3 { border-left-color: var(--d3); }
.dimension-border-4 { border-left-color: var(--d4); }
.dimension-border-5 { border-left-color: var(--d5); }
.dimension-border-6 { border-left-color: var(--d6); }
.question-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.q-number { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); font-weight: 900; }
.lang-ta .q-number { text-transform: none; letter-spacing: 0; }
.dimension-chip { font-size: 11px; font-weight: 900; padding: 6px 9px; border-radius: 999px; }
.dimension-chip-1 { background: #e9efff; color: #2750c3; }
.dimension-chip-2 { background: #ffeaf0; color: #bd3157; }
.dimension-chip-3 { background: #e5f8f2; color: #08795b; }
.dimension-chip-4 { background: #fff2de; color: #ac6410; }
.dimension-chip-5 { background: #f0eaff; color: #6540b5; }
.dimension-chip-6 { background: #ffe9f3; color: #b93a75; }
.question-card h2 { font-size: 20px; margin: 10px 0 18px; }
.scale-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.scale-option {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 12px 9px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    transition: .15s ease;
    background: #fff;
    position: relative;
}
.scale-option:hover { border-color: #9fb7f0; background: #fafbff; transform: translateY(-1px); }
.scale-option input { margin: 0 0 7px; accent-color: var(--primary); }
.scale-option .score { display: block; font-size: 18px; font-weight: 950; }
.scale-option .label { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.scale-option.selected { border-width: 2px; box-shadow: 0 7px 17px rgba(42,62,113,.10); }
.score-option-1 .score { color: #c44141; }
.score-option-2 .score { color: #d87b32; }
.score-option-3 .score { color: #8b7c24; }
.score-option-4 .score { color: #228c6b; }
.score-option-5 .score { color: #2466ce; }
.score-option-1.selected { background: #fff1f1; border-color: #e88b8b; }
.score-option-2.selected { background: #fff5e9; border-color: #edb77d; }
.score-option-3.selected { background: #fffbe5; border-color: #d9ca6e; }
.score-option-4.selected { background: #eaf9f3; border-color: #76cbb1; }
.score-option-5.selected { background: #edf4ff; border-color: #7aa5ea; }

.submit-panel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-top: 18px; }
.navigation-panel { position: sticky; bottom: 12px; z-index: 5; border-top: 3px solid #d7def0; }
.nav-side.right { text-align: right; }
.page-summary { font-size: 13px; font-weight: 900; color: var(--muted); text-align: center; }

.recommendation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 18px; }
.recommendation-card { border: 2px solid #b9cafa; background: linear-gradient(180deg, #fff, #f7f9ff); position: relative; overflow: hidden; }
.recommendation-card::after { content: ""; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.38); position: absolute; right: -65px; top: -65px; }
.dimension-result-1 { border-color: #9db4ef; background: linear-gradient(135deg, #f8faff, #eaf0ff); }
.dimension-result-2 { border-color: #efb0c1; background: linear-gradient(135deg, #fff9fb, #ffeaf0); }
.dimension-result-3 { border-color: #8ed7c5; background: linear-gradient(135deg, #f8fffc, #e6f8f2); }
.dimension-result-4 { border-color: #efc27d; background: linear-gradient(135deg, #fffdf8, #fff1da); }
.dimension-result-5 { border-color: #c3adeb; background: linear-gradient(135deg, #fdfbff, #f0eaff); }
.dimension-result-6 { border-color: #efafd0; background: linear-gradient(135deg, #fffafd, #ffeaf4); }
.badge { display: inline-block; background: var(--success-soft); color: var(--success); border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 900; position: relative; z-index: 1; }
.recommendation-card h2 { margin: 14px 0 6px; font-size: 29px; position: relative; z-index: 1; }
.dimension-result-desc { margin: 0 0 15px; color: var(--muted); }
.score-cluster { display: flex; gap: 15px; align-items: flex-end; }
.big-score { font-size: 50px; font-weight: 950; color: var(--primary); line-height: 1; }
.big-score span { font-size: 20px; color: var(--muted); }
.percent { font-size: 24px; font-weight: 950; }
.alignment { color: var(--success); font-weight: 900; }
.course-box { background: rgba(255,255,255,.7); border: 1px solid rgba(100,110,150,.15); border-radius: 14px; padding: 14px; margin-top: 14px; }
.course-box h3 { margin: 0 0 7px; font-size: 16px; }
.course-box p { margin: 0; }
.profile-card { border-top: 5px solid #7457d6; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.section-heading h2 { margin: 4px 0 0; }
.result-list { display: grid; gap: 12px; }
.result-row {
    display: grid;
    grid-template-columns: 1.7fr 90px 70px;
    gap: 10px 14px;
    align-items: center;
    border: 1px solid var(--border);
    border-left-width: 5px;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}
.result-dimension-1 { border-left-color: var(--d1); }
.result-dimension-2 { border-left-color: var(--d2); }
.result-dimension-3 { border-left-color: var(--d3); }
.result-dimension-4 { border-left-color: var(--d4); }
.result-dimension-5 { border-left-color: var(--d5); }
.result-dimension-6 { border-left-color: var(--d6); }
.result-row.highlight { background: #f7f9ff; box-shadow: 0 5px 13px rgba(55,70,120,.08); }
.result-title strong { display: block; }
.result-title span { color: var(--muted); font-size: 13px; }
.result-score, .result-percent { font-weight: 950; text-align: right; }
.bar { grid-column: 1 / -1; height: 9px; border-radius: 999px; background: #e9eef6; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; }
.bar-1 span { background: linear-gradient(90deg, #3568e8, #7a9af1); }
.bar-2 span { background: linear-gradient(90deg, #e34f76, #f293aa); }
.bar-3 span { background: linear-gradient(90deg, #14a67e, #66cfb5); }
.bar-4 span { background: linear-gradient(90deg, #f09a31, #f7c068); }
.bar-5 span { background: linear-gradient(90deg, #8256d8, #b292ec); }
.bar-6 span { background: linear-gradient(90deg, #e85f9c, #f0a0c4); }

.interpretation-card { margin-top: 18px; border-top: 5px solid #13a57c; }
.interpretation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.interpretation-grid div { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.interpretation-grid strong, .interpretation-grid span { display: block; }
.interpretation-grid span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.level-very { background: #eaf8f1; }
.level-strong { background: #edf5ff; }
.level-moderate { background: #fff8e6; }
.level-low { background: #fff0f0; }
.guidance-note { margin-bottom: 0; }
.actions { display: flex; justify-content: center; margin-top: 18px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }

@media (max-width: 820px) {
    .scale-grid { grid-template-columns: 1fr; }
    .scale-option { display: grid; grid-template-columns: 26px 36px 1fr; align-items: center; text-align: left; gap: 8px; }
    .scale-option input { margin: 0; }
    .scale-option .label { font-size: 13px; margin: 0; }
    .topbar, .section-heading { align-items: stretch; flex-direction: column; }
    .test-status { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .submit-panel { position: static; grid-template-columns: 1fr; }
    .nav-side, .nav-side.right, .page-summary { text-align: center; }
    .nav-side .btn { width: 100%; }
    .result-row { grid-template-columns: 1fr 70px 60px; }
    .interpretation-grid { grid-template-columns: 1fr 1fr; }
    .mini-scale { grid-template-columns: 1fr; }
    .mini-scale span { text-align: left; }
    .mini-scale b { display: inline; margin-right: 5px; }
}

@media (max-width: 600px) {
    .page-progress { gap: 4px; }
    .progress-step { min-height: 46px; border-radius: 9px; }
    .progress-step small { display: none; }
    .dimension-banner { align-items: flex-start; padding: 18px; }
    .dimension-icon { width: 48px; height: 48px; font-size: 24px; }
    .question-heading-row { align-items: flex-start; flex-direction: column; }
    .language-panel { align-items: stretch; flex-direction: column; }
    .language-switch { width: 100%; }
    .language-btn { flex: 1; text-align: center; }
}

@media (max-width: 520px) {
    .page-shell, .page-shell.narrow, .test-shell { width: min(100% - 20px, 1120px); margin-top: 12px; }
    .card { padding: 18px; border-radius: 15px; }
    .hero { padding: 25px 20px; border-radius: 19px; }
    .interpretation-grid { grid-template-columns: 1fr; }
}

@media print {
    body { background: #fff; }
    .page-shell { width: 100%; margin: 0; }
    .card, .hero { box-shadow: none; }
    .no-print, .btn { display: none !important; }
    .recommendation-card { break-inside: avoid; }
}

/* =========================================================
   HOME / INDEX PAGE - PROFESSIONAL CENTERED HERO
   ========================================================= */

.home-hero {
    text-align: center;
    padding: 32px 28px;
}

.home-hero .hero-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-align: center;
}

.home-hero .hero-copy {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.home-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 14px;
    padding: 7px 13px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .02em;
    position: relative;
    z-index: 2;
}

.home-hero .college-name {
    margin: 0 auto;
    text-align: center;
    max-width: 920px;
}

.home-hero .hero-divider {
    width: 76px;
    height: 3px;
    margin: 15px auto 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.75);
    position: relative;
    z-index: 2;
}

.home-hero .assessment-title {
    margin: 0 auto 7px;
    text-align: center;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 850;
    position: relative;
    z-index: 2;
}

.home-hero .hero-subtitle {
    margin: 0 auto;
    text-align: center;
    font-size: 16px;
    line-height: 1.55;
    opacity: .94;
    position: relative;
    z-index: 2;
}

.home-hero .hero-points {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 17px auto 0;
    position: relative;
    z-index: 2;
}

.home-hero .hero-points span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.16);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

/* Small centered career-guidance image */
.home-hero .hero-visual {
    width: 100%;
    min-height: 0;
    margin: 16px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.home-hero .hero-visual img {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.home-hero .visual-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 165px;
    height: 165px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255,255,255,.11);
    filter: blur(2px);
    pointer-events: none;
    z-index: 1;
}

/* Registration card refinements */
.register-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.register-card form input {
    min-height: 48px;
}

.register-card .btn.primary {
    min-height: 50px;
    font-size: 16px;
}

/* =========================================================
   TAMIL ONLY - SMALLER HEADINGS
   ========================================================= */

.lang-ta .home-hero .college-name {
    font-size: 27px;
    line-height: 1.45;
}

.lang-ta .home-hero .assessment-title {
    font-size: 20px;
    line-height: 1.5;
}

.lang-ta .home-hero .hero-subtitle {
    font-size: 14px;
    line-height: 1.6;
}

.lang-ta .home-hero .hero-badge {
    font-size: 12px;
}

.lang-ta .register-card h2 {
    font-size: 20px;
}

.lang-ta .card h3 {
    font-size: 17px;
}

/* =========================================================
   HOME HERO - TABLET / MOBILE
   ========================================================= */

@media (max-width: 820px) {
    .home-hero {
        padding: 28px 22px;
    }

    .home-hero .hero-copy {
        max-width: 100%;
    }

    .home-hero .hero-points {
        justify-content: center;
    }

    .home-hero .hero-visual {
        margin-top: 14px;
    }

    .home-hero .hero-visual img {
        max-width: 165px;
    }

    .home-hero .visual-glow {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 520px) {
    .home-hero {
        padding: 24px 16px 22px;
        border-radius: 19px;
    }

    .home-hero .hero-badge {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .home-hero .college-name {
        font-size: 29px;
        line-height: 1.25;
    }

    .home-hero .assessment-title {
        font-size: 19px;
    }

    .home-hero .hero-subtitle {
        font-size: 14px;
    }

    .home-hero .hero-points {
        flex-direction: column;
        gap: 7px;
        width: 100%;
    }

    .home-hero .hero-points span {
        width: 100%;
        max-width: 280px;
        white-space: normal;
    }

    .home-hero .hero-visual {
        margin-top: 12px;
    }

    .home-hero .hero-visual img {
        max-width: 140px;
    }

    .home-hero .visual-glow {
        width: 130px;
        height: 130px;
    }

    .lang-ta .home-hero .college-name {
        font-size: 22px;
        line-height: 1.5;
    }

    .lang-ta .home-hero .assessment-title {
        font-size: 17px;
        line-height: 1.55;
    }

    .lang-ta .home-hero .hero-subtitle {
        font-size: 13px;
    }

    .lang-ta .home-hero .hero-badge {
        font-size: 11px;
    }

    .lang-ta .register-card h2 {
        font-size: 18px;
    }
}