:root {
    --purple-deep: #4A1D6E;
    --purple-rich: #6B2D9E;
    --purple-soft: #9B6DC6;
    --purple-pale: #E8DDF2;
    --teal-deep: #0D4F4F;
    --teal-rich: #1A7A7A;
    --teal-bright: #2AADAD;
    --teal-pale: #D4F0F0;
    --cream: #FDFBF7;
    --white: #FFFFFF;
    --charcoal: #2D2A33;
    --muted: #6D6877;
    --border: rgba(107, 45, 158, 0.16);
    --strong-border: rgba(107, 45, 158, 0.26);
    --shadow: 0 20px 60px rgba(74, 29, 110, 0.12);
    --green: #187A50;
    --green-bg: #E5F5EC;
    --yellow: #87610F;
    --yellow-bg: #FFF4D6;
    --red: #A53131;
    --red-bg: #FDE7E7;
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--charcoal);
    font-family: "DM Sans", sans-serif;
    line-height: 1.55;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--teal-deep);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 3.5rem;
    background: rgba(253, 251, 247, 0.94);
    border-bottom: 1px solid rgba(107, 45, 158, 0.12);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--purple-deep);
    font-family: "Nunito", sans-serif;
    font-size: 1.28rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.7rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links a {
    color: var(--charcoal);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--purple-deep);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--strong-border);
    border-radius: 12px;
    background: transparent;
    color: var(--purple-deep);
}

.nav-toggle span:not(.sr-only) {
    width: 20px;
    height: 2px;
    background: currentColor;
}

main {
    width: min(1360px, calc(100% - 36px));
    margin: 0 auto;
    padding: 3.2rem 0 5rem;
}

.tool-hero {
    min-height: calc(100vh - 86px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

.hero-copy {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tool-mark,
.section-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: white;
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-rich));
}

.tool-mark {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(74, 29, 110, 0.24);
}

.tool-mark svg,
.section-icon svg {
    width: 32px;
    height: 32px;
}

h1,
h2,
h3,
legend {
    font-family: "Nunito", sans-serif;
    letter-spacing: 0;
}

h1 {
    margin: 0;
    color: var(--purple-deep);
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    line-height: 1.04;
}

.hero-copy p,
.section-title p,
.snapshot-heading p,
.panel-heading p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.86fr) minmax(520px, 1.14fr);
    gap: 2rem;
    align-items: stretch;
}

.panel,
.analyzer-shell,
.loading-panel,
.results-shell,
.setup-note {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: clamp(1.2rem, 3vw, 2rem);
}

.panel-heading,
.snapshot-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.4rem;
}

.panel-heading {
    justify-content: flex-start;
}

.section-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
}

.section-icon svg {
    width: 22px;
    height: 22px;
}

.panel h2,
.section-title h2,
.results-actions h2,
.setup-note h2,
.loading-panel h2 {
    margin: 0;
    color: var(--purple-deep);
    font-size: 1.5rem;
    line-height: 1.2;
}

label {
    display: block;
    margin: 1rem 0 0.42rem;
    color: #40394a;
    font-size: 0.92rem;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(45, 42, 51, 0.18);
    border-radius: 13px;
    background: white;
    color: var(--charcoal);
    padding: 0.88rem 1rem;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
    resize: vertical;
    min-height: 126px;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(42, 173, 173, 0.36);
    outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--teal-rich);
    box-shadow: 0 0 0 4px rgba(42, 173, 173, 0.12);
}

.field-error {
    min-height: 1.15rem;
    margin: 0.3rem 0 0;
    color: var(--red);
    font-size: 0.85rem;
    font-weight: 700;
}

.access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.8rem 0 1.2rem;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.check-inline input {
    width: 18px;
    height: 18px;
    accent-color: var(--teal-rich);
}

.access-row a {
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 13px;
    min-height: 46px;
    border: 1px solid transparent;
    padding: 0.8rem 1.1rem;
    font-weight: 900;
    text-decoration: none;
}

.primary-button {
    width: 100%;
    background: var(--purple-deep);
    color: white;
    box-shadow: 0 14px 28px rgba(74, 29, 110, 0.2);
}

.primary-button:hover {
    background: var(--purple-rich);
}

.primary-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.primary-button svg {
    width: 19px;
    height: 19px;
}

.secondary-button,
.ghost-button,
.copy-button {
    background: white;
    border-color: var(--strong-border);
    color: var(--purple-deep);
}

.secondary-button:hover,
.ghost-button:hover,
.copy-button:hover {
    border-color: var(--purple-rich);
}

.uses-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.35rem;
    padding: 1rem;
    border: 1px solid rgba(42, 173, 173, 0.25);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(212, 240, 240, 0.9), rgba(255, 255, 255, 0.78));
}

.meter {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--teal-rich) 80%, rgba(42, 173, 173, 0.18) 0);
    color: white;
    font-family: "Nunito", sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
}

.uses-card strong,
.uses-card span {
    display: block;
}

.uses-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.privacy-note {
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
    margin: 1.2rem 0 0;
}

.status-message {
    margin-top: 1rem;
    color: var(--teal-deep);
    font-weight: 800;
}

.status-message.error {
    color: var(--red);
}

.score-preview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.2rem;
}

.score-ring {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, white 0 53%, transparent 54%),
        conic-gradient(var(--teal-rich) 86%, rgba(42, 173, 173, 0.16) 0);
}

.score-ring span {
    color: var(--purple-deep);
    font-family: "Nunito", sans-serif;
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1;
}

.score-ring small {
    margin-top: -2.5rem;
    color: var(--muted);
    font-weight: 800;
}

.score-preview h3 {
    margin: 0 0 0.35rem;
    color: var(--teal-deep);
    font-size: 1.3rem;
}

.score-preview p,
.mini-card p {
    margin: 0;
    color: var(--muted);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.mini-card {
    min-height: 164px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.mini-card strong {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--purple-deep);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.34rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 900;
}

.badge-green {
    color: var(--green);
    background: var(--green-bg);
}

.badge-yellow {
    color: var(--yellow);
    background: var(--yellow-bg);
}

.badge-red {
    color: var(--red);
    background: var(--red-bg);
}

.snapshot-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(253, 251, 247, 0.75);
    color: var(--teal-deep);
    font-weight: 900;
}

.analyzer-shell {
    margin-top: 2rem;
    padding: clamp(1.3rem, 3vw, 2.2rem);
    position: relative;
}

.analyzer-shell.locked .idea-form {
    opacity: 0.42;
    pointer-events: none;
    user-select: none;
}

.analyzer-shell.locked::after {
    content: "Unlock access above to use the analyzer form.";
    position: absolute;
    inset: auto 2rem 2rem auto;
    max-width: 310px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(42, 173, 173, 0.25);
    border-radius: 14px;
    background: var(--teal-pale);
    color: var(--teal-deep);
    font-weight: 900;
}

.section-title {
    text-align: center;
    margin-bottom: 1.4rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.2rem;
}

.span-2 {
    grid-column: 1 / -1;
}

fieldset {
    margin: 1.4rem 0 0;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(253, 251, 247, 0.5);
}

legend {
    padding: 0 0.35rem;
    color: var(--purple-deep);
    font-size: 1.15rem;
    font-weight: 900;
}

fieldset > p {
    margin: 0.2rem 0 1rem;
    color: var(--muted);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.option-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    margin: 0;
    padding: 0.8rem;
    border: 1px solid rgba(45, 42, 51, 0.13);
    border-radius: 13px;
    background: white;
    color: var(--charcoal);
    font-size: 0.92rem;
    font-weight: 700;
}

.option-check:has(input:checked) {
    border-color: rgba(42, 173, 173, 0.65);
    background: rgba(212, 240, 240, 0.52);
}

.option-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--teal-rich);
}

.other-line {
    margin-top: 0.8rem;
}

.form-actions,
.results-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.form-actions {
    margin-top: 1.5rem;
}

.form-actions .primary-button {
    width: auto;
}

.loading-panel {
    margin-top: 2rem;
    padding: 3rem 2rem;
    text-align: center;
}

.spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto 1.1rem;
    border: 5px solid rgba(42, 173, 173, 0.2);
    border-top-color: var(--purple-rich);
    border-radius: 50%;
    animation: spin 850ms linear infinite;
}

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

.results-shell {
    margin-top: 2rem;
    padding: clamp(1.3rem, 3vw, 2.2rem);
}

.results-actions {
    margin-bottom: 1.4rem;
}

.results-actions p {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.report-grid {
    display: grid;
    gap: 1rem;
}

.score-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1.2rem;
    align-items: center;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, white, rgba(212, 240, 240, 0.36));
}

.score-number {
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    border-radius: 50%;
    color: var(--purple-deep);
    background:
        radial-gradient(circle at center, white 0 54%, transparent 55%),
        conic-gradient(var(--teal-rich) var(--score-progress), rgba(42, 173, 173, 0.18) 0);
    font-family: "Nunito", sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
}

.score-number small {
    display: block;
    margin-top: -2.8rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.score-card h3 {
    margin: 0 0 0.35rem;
    color: var(--purple-deep);
    font-size: 1.45rem;
}

.score-card p {
    margin: 0;
    color: var(--muted);
}

.report-section {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    overflow: hidden;
}

.report-section-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    background: rgba(253, 251, 247, 0.82);
    border-bottom: 1px solid var(--border);
}

.report-section h3 {
    margin: 0;
    color: var(--purple-deep);
    font-size: 1.18rem;
}

.report-section-body {
    padding: 1rem 1.1rem 1.1rem;
}

.report-section p {
    margin: 0;
    color: var(--charcoal);
}

.report-section ul,
.strategy-list,
.roadmap-list {
    margin: 0;
    padding-left: 1.15rem;
}

.report-section li + li,
.strategy-card li + li {
    margin-top: 0.45rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.detail-box,
.strategy-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(253, 251, 247, 0.54);
}

.detail-box strong,
.strategy-card strong {
    display: block;
    color: var(--purple-deep);
    margin-bottom: 0.35rem;
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.setup-note {
    margin-top: 2rem;
    padding: 1.4rem;
}

.setup-note p {
    margin: 0.35rem 0 0.75rem;
    color: var(--muted);
}

@media (max-width: 1080px) {
    .hero-grid,
    .detail-grid,
    .strategy-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .site-nav {
        padding: 0.9rem 1rem;
        align-items: flex-start;
    }

    .brand span {
        font-size: 1rem;
        white-space: normal;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 1rem 1rem;
        background: var(--cream);
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 0.85rem;
        border-radius: 12px;
    }

    main {
        width: min(100% - 24px, 1360px);
        padding-top: 2rem;
    }

    .tool-hero {
        min-height: 0;
    }

    .hero-copy {
        align-items: flex-start;
    }

    .tool-mark {
        width: 54px;
        height: 54px;
        border-radius: 18px;
    }

    .hero-grid,
    .form-grid,
    .preview-grid,
    .checkbox-grid,
    .snapshot-footer,
    .score-card {
        grid-template-columns: 1fr;
    }

    .access-row,
    .form-actions,
    .results-actions,
    .panel-heading,
    .snapshot-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .primary-button,
    .secondary-button {
        width: 100%;
    }

    .analyzer-shell.locked::after {
        position: static;
        display: block;
        margin-top: 1rem;
    }
}

@media print {
    .site-nav,
    .tool-hero,
    .analyzer-shell,
    .loading-panel,
    .setup-note,
    .print-hide,
    .copy-button {
        display: none !important;
    }

    main {
        width: 100%;
        padding: 0;
    }

    .results-shell {
        display: block !important;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .report-section,
    .score-card {
        break-inside: avoid;
        box-shadow: none;
    }
}
