:root {
    --navy: #062033;
    --navy-2: #0a334c;
    --ink: #10233a;
    --muted: #5b6b7c;
    --line: #d7e1ea;
    --paper: #f3f7fb;
    --panel: #ffffff;
    --teal: #0f8f86;
    --teal-dark: #0b6e68;
    --blue: #1d4ed8;
    --ok: #0f7a5c;
    --err: #b42318;
    --shadow: 0 24px 60px rgba(6, 32, 51, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

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

h1, h2, .hello-word, .auth-title, .page-title {
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.03em;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--teal);
}

.lede, .section-copy {
    color: var(--muted);
    line-height: 1.6;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(180deg, #147f78, var(--teal-dark));
    color: #fff;
    box-shadow: 0 10px 24px rgba(11, 110, 104, 0.28);
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-secondary {
    background: #e8eef4;
    color: var(--navy);
}

.btn-quiet {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--line);
    padding: 8px 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    margin-bottom: 16px;
}

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

.password-field {
    position: relative;
    margin-bottom: 16px;
}

.password-field input {
    margin-bottom: 0;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}

.password-toggle:hover { color: var(--ink); background: var(--paper); }
.password-toggle:focus-visible { outline: 2px solid rgba(15, 143, 134, 0.35); }

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.captcha-challenge {
    flex: 0 0 auto;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--navy);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.captcha-row input { margin-bottom: 0; flex: 1; min-width: 0; }

input:focus {
    outline: 2px solid rgba(15, 143, 134, 0.35);
    border-color: var(--teal);
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.remember input { margin: 0; }

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 18px;
}

.remember-row .remember { margin: 0; }

.forgot-link { font-size: 14px; font-weight: 600; }

.switch { margin: 22px 0 0; color: var(--muted); }

.error { color: var(--err); font-size: 13px; margin: -8px 0 14px; }

.alert {
    background: #e8f7f1;
    color: var(--ok);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.auth-title { margin: 0 0 8px; font-size: 36px; }

.form-panel .btn-primary { width: 100%; }

.auth-body {
    background:
        radial-gradient(1100px 520px at 15% -10%, rgba(15, 143, 134, 0.10), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(6, 32, 51, 0.08), transparent 55%),
        var(--paper);
    min-height: 100vh;
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 56px 20px 80px;
}

.auth-card {
    width: 100%;
    max-width: 980px;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    overflow: hidden;
    display: grid;
    grid-template-columns: 0.82fr 1fr;
    align-items: stretch;
}

.auth-intro {
    background: var(--paper);
    border-right: 1px solid var(--line);
    padding: 44px 40px;
}

.auth-intro-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--navy);
    color: #d7fff6;
    margin-bottom: 18px;
}

.auth-intro .eyebrow { color: var(--navy); }

.auth-intro h1 {
    margin: 0 0 12px;
    font-size: 40px;
    color: var(--navy);
}

.auth-intro .lede { margin: 0 0 22px; font-size: 15px; }

.auth-intro-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-intro-list li {
    position: relative;
    padding-left: 24px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.auth-intro-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
}

.auth-form {
    display: flex;
    align-items: center;
    padding: 44px 40px;
}

.auth-form-inner { width: 100%; }

.auth-form .auth-title { font-size: 26px; margin-bottom: 6px; }

.auth-form .btn-primary { width: 100%; margin-top: 6px; }

@media (max-width: 820px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-intro { border-right: 0; border-bottom: 1px solid var(--line); padding: 32px 28px; }
    .auth-form { padding: 32px 28px; }
}

.app-body { background: var(--paper); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 36px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--navy);
}

.logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: #d7fff6;
    font-weight: 800;
    font-size: 13px;
}

.logo strong { display: block; font-size: 14px; }
.logo small { color: var(--muted); font-size: 11px; }

.site-nav { display: flex; gap: 8px; }

.site-nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 999px;
}

.site-nav a.is-active,
.site-nav a:hover {
    background: #eef6f5;
    color: var(--navy);
}

.header-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #d9f3ef;
    color: var(--teal-dark);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.header-user-meta { display: flex; flex-direction: column; }
.header-user-meta strong { font-size: 13px; }
.header-user-meta span { font-size: 12px; color: var(--muted); }

.site-main { padding-bottom: 40px; }

.page-narrow { max-width: 980px; margin: 40px auto; padding: 0 20px; }
.page-title { margin: 0 0 8px; font-size: 42px; }

.form-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.calc-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    max-width: 1180px;
    margin: 28px auto 10px;
    padding: 28px 28px 8px;
}

.hello-word {
    margin: 0 0 14px;
    font-size: clamp(42px, 6vw, 72px);
    line-height: 0.95;
    color: var(--navy);
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.calc-hero img {
    width: 100%;
    border-radius: 28px;
    box-shadow: var(--shadow);
    object-fit: cover;
    min-height: 320px;
}

.calc-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 28px;
    text-align: center;
}

.calc-section h2 { margin: 0 0 8px; font-size: 34px; }

.calc-cards,
.module-grid,
.user-grid,
.side-grid {
    display: grid;
    gap: 18px;
    text-align: left;
}

.calc-cards { grid-template-columns: repeat(5, 1fr); margin-top: 28px; }
.module-grid { grid-template-columns: repeat(3, 1fr); margin-top: 28px; }
.user-grid { grid-template-columns: repeat(3, 1fr); margin-top: 28px; }

.calc-card,
.module-card,
.main-card,
.small-card,
.step {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.calc-card h3, .module-card h3, .main-card h3, .step h3 {
    font-family: "Plus Jakarta Sans", sans-serif;
    letter-spacing: 0;
    font-size: 16px;
    margin: 0 0 8px;
}

.calc-card p, .module-card p, .step p, .small-card p { margin: 0; color: var(--muted); font-size: 14px; }

.calc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #e8f6f4;
    margin-bottom: 14px;
}

.module-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.mod-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    margin-bottom: 12px;
}

.mod-icon.blue { background: #1d4ed8; }
.mod-icon.green { background: #0f9d58; }
.mod-icon.dark { background: #1f3b57; }
.mod-icon.orange { background: #d97706; }
.mod-icon.red { background: #dc2626; }
.mod-icon.ember { background: #b45309; }

.info { font-size: 12px; color: #7b8a99; margin: 12px 0 18px; }

.module-card .btn-primary { width: 100%; border-radius: 12px; }

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 36px 0 28px;
    text-align: left;
}

.circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    margin-bottom: 12px;
}

.method-container {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
    text-align: left;
    margin-top: 28px;
}

.main-card ul { padding-left: 18px; color: var(--muted); }
.main-card li { margin-bottom: 8px; }

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

.user-card {
    border-radius: 22px;
    padding: 24px;
    color: #fff;
    text-align: left;
}

.user-card h3 { font-family: "Plus Jakarta Sans", sans-serif; margin: 0 0 8px; }
.user-card p, .user-card li { color: rgba(255,255,255,0.86); font-size: 14px; }
.user-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.16);
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}

.tone-blue { background: linear-gradient(145deg, #163e73, #1d4ed8); }
.tone-green { background: linear-gradient(145deg, #0b6b45, #16a34a); }
.tone-teal { background: linear-gradient(145deg, #0b5f5a, #0f8f86); }

.calc-cta {
    margin-top: 36px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    text-align: left;
    box-shadow: var(--shadow);
}

.calc-cta h3 { margin: 0 0 6px; font-family: "Plus Jakarta Sans", sans-serif; }
.calc-cta p { margin: 0; color: var(--muted); }

.calc-footer {
    text-align: center;
    padding: 28px;
    color: #9aa8b5;
    font-size: 13px;
}

.alert-error {
    background: #fdecea;
    color: var(--err);
}

.optional, .field-hint {
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
}

.page-wide {
    max-width: 1180px;
    margin: 32px auto;
    padding: 0 24px 40px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin: 18px 0 20px;
}

.search-bar input { margin: 0; }

.search-bar .btn-primary { width: auto; }

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-small { padding: 7px 12px; font-size: 12px; }

.btn-danger {
    background: #b42318;
    color: #fff;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-ok { background: #e8f7f1; color: var(--ok); }
.badge-off { background: #fdecea; color: var(--err); }

.detail-list p {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.detail-list span { color: var(--muted); text-align: right; }

.pager { margin-top: 18px; }

.sector-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 16px;
}

.sector-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sector-tab:hover { border-color: var(--teal); color: var(--ink); }

.sector-tab.is-active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.sector-tab-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--paper);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.sector-tab.is-active .sector-tab-count { background: rgba(255, 255, 255, 0.2); color: #fff; }

.result-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 18px;
}

.result-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.result-card-head h3 { margin: 2px 0 0; font-size: 20px; }
.result-card .eyebrow { margin: 0; }

.detail-scenario {
    margin: 16px 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.detail-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}

.detail-table th,
.detail-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: right;
}

.detail-table th { background: var(--paper); color: var(--muted); font-weight: 600; text-align: right; }

.detail-table th:first-child,
.detail-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }

.detail-table thead th:first-child { background: var(--paper); }

.detail-table tr :last-child { border-right: 0; }
.detail-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 980px) {
    .calc-hero, .module-grid, .method-container, .user-grid, .steps, .calc-cards {
        grid-template-columns: 1fr;
    }
    .site-header { flex-wrap: wrap; }
    .header-user { width: 100%; }
    .calc-hero img { min-height: 220px; }
    .side-grid { grid-template-columns: 1fr 1fr; }
    .calc-cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .header-user-meta { display: none; }
    .side-grid { grid-template-columns: 1fr; }
}
