:root {
    --bg-main: #eef2f6;
    --bg-soft: #f7f9fc;
    --card-bg: #ffffff;
    --card-muted: #f3f6fa;
    --text-main: #14223a;
    --text-muted: #5b6b84;
    --border: #d8e0eb;
    --accent: #0f766e;
    --accent-hover: #0d665f;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --danger: #b42318;
    --shadow-sm: 0 4px 14px rgba(20, 34, 58, 0.06);
    --shadow-lg: 0 18px 36px rgba(20, 34, 58, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12) 0, transparent 36%),
        radial-gradient(circle at 85% 0, rgba(20, 34, 58, 0.1) 0, transparent 30%),
        var(--bg-main);
    min-height: 100vh;
    padding: 2.5rem 1.25rem;
}

.page-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.app-hero {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(15, 118, 110, 0.05) 65%, rgba(14, 165, 233, 0.04)),
        #ffffff;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    color: var(--text-main);
    padding: 0.56rem 0.95rem 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0.35rem 0.65rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.app-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: linear-gradient(90deg, #0d2f6e 0%, #1c4b96 52%, #4ca3e6 100%);
}

.app-hero::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    right: -140px;
    top: -140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0));
    pointer-events: none;
}

.hero-copy,
.hero-actions {
    position: relative;
    z-index: 1;
}

.hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.hero-logo {
    width: 4.8rem;
    height: 2.5rem;
    object-fit: contain;
}

.hero-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #334155;
    font-weight: 800;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    max-width: 62ch;
    line-height: 1.22;
    font-size: 0.76rem;
    margin-left: 0;
    margin-top: -0.4rem;
}

.hero-meta {
    margin-top: 0.04rem;
    font-size: 0.64rem;
    text-transform: none;
    letter-spacing: 0.03em;
    color: #4c6283;
    font-weight: 600;
    margin-left: 0.62rem;
}

.hero-meta strong {
    font-weight: 800;
    color: #314a70;
}

.subtitle strong {
    color: var(--text-main);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-self: start;
    margin-top: 0.5rem;
}

.account-menu {
    position: relative;
}

.account-chip {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: #334155;
    border-radius: 999px;
    padding: 0.28rem 0.54rem;
    font-size: 0.68rem;
    line-height: 1.2;
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.account-chip::-webkit-details-marker {
    display: none;
}

.account-chip::after {
    content: '';
    width: 0.42rem;
    height: 0.42rem;
    border-right: 1.5px solid #64748b;
    border-bottom: 1.5px solid #64748b;
    transform: rotate(45deg) translateY(-1px);
}

.account-menu[open] .account-chip {
    border-color: #b7c8df;
    background: #eef3fa;
}

.account-chip strong {
    color: var(--text-main);
    font-weight: 700;
}

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.1rem);
    min-width: 5.2rem;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 0.55rem;
    box-shadow: var(--shadow-sm);
    padding: 0;
    z-index: 10;
}

.account-dropdown-link {
    display: block;
    text-decoration: none;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.36rem 0.5rem;
    border-radius: 0.4rem;
}

.account-dropdown-link:hover {
    background: #eff4fb;
}

.link-button,
.primary-link-button {
    border-radius: 0.7rem;
    padding: 0.46rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-button {
    color: #334155;
    border: 1px solid var(--border);
}

.link-button:hover {
    background: #eef3fa;
}

.primary-link-button {
    color: #ffffff;
    background: #1c4b96;
    border: 1px solid transparent;
}

.primary-link-button:hover {
    background: #0d2f6e;
}

.sign-in-cta {
    display: inline-flex;
    width: fit-content;
    justify-self: start;
}

.top-error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: var(--danger);
    border-radius: 0.8rem;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-wizard {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.wizard-layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    min-height: 640px;
}

.wizard-nav-panel {
    background: #f8fafc;
    border-right: 1px solid var(--border);
    padding: 1.25rem 1rem;
    display: grid;
    align-content: start;
    gap: 1.25rem;
    align-items: start;
}

.wizard-nav-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wizard-nav-list {
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.wizard-step-button {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    background: transparent;
    padding: 0.62rem 0.7rem;
    display: flex;
    gap: 0.65rem;
    align-items: center;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    transition: all 0.18s ease;
}

.wizard-step-button:hover {
    background: #eef4fb;
}

.wizard-step-button.is-active {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.11);
}

.wizard-step-button.is-complete .wizard-step-index {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.wizard-step-index {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #ffffff;
    flex-shrink: 0;
}

.wizard-step-copy {
    min-width: 0;
    display: grid;
    gap: 0.05rem;
}

.wizard-step-name {
    font-size: 0.88rem;
    font-weight: 600;
}

.wizard-step-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.wizard-progress-panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.8rem;
    display: grid;
    gap: 0.45rem;
    margin-top: auto;
}

.wizard-progress-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wizard-progress-track {
    height: 0.45rem;
    border-radius: 999px;
    background: #e8edf5;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #0a9488);
    transition: width 0.2s ease;
}

.wizard-progress-value {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.wizard-content-panel {
    background: var(--card-bg);
    padding: 1.15rem;
}

.wizard-step-card {
    display: grid;
    gap: 1.2rem;
}

.wizard-step-card[hidden] {
    display: none;
}

.wizard-step-header {
    display: grid;
    gap: 0.3rem;
}

.wizard-step-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

h2 {
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
    line-height: 1.2;
}

.wizard-step-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.form-group {
    grid-column: span 10;
    display: grid;
    gap: 0.45rem;
}

.form-group.w-6 {
    grid-column: span 6;
}

.form-group.w-4 {
    grid-column: span 4;
}

.form-group.w-full {
    grid-column: span 10;
}

label {
    display: block;
    font-size: 0.83rem;
    font-weight: 700;
    color: #27364f;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

input[type="text"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.58rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    font-size: 0.93rem;
    transition: all 0.2s;
    background: var(--bg-soft);
    color: var(--text-main);
    font-family: inherit;
}

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

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #ffffff;
}

.checkbox-list {
    display: grid;
    gap: 0.7rem;
    background: var(--card-muted);
    padding: 0.68rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.checkbox-list:not([data-limited-field]) {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.limited-controls {
    display: block;
}

.limited-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.6rem;
}

.field-help {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.field-error {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 600;
}

.selection-count {
    margin: 0;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.checkbox-item.limited-item {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.36rem 0.44rem;
}

.checkbox-item.limited-item.is-hidden {
    display: none;
}

.checkbox-item input {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    margin-top: 0.12rem;
}

.ordering-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--card-muted);
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.ordering-option {
    margin: 0;
    white-space: nowrap;
}

.checkbox-content {
    display: grid;
    gap: 0.1rem;
}

.checkbox-title {
    font-size: 0.79rem;
    font-weight: 600;
}

.checkbox-subtitle,
.checkbox-meta {
    font-size: 0.69rem;
    color: var(--text-muted);
}

.selected-order {
    margin-top: 0.45rem;
}

.selected-order-title {
    margin: 0 0 0.32rem;
    font-size: 0.71rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.selected-order-list {
    display: grid;
    gap: 0.35rem;
}

.selected-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: #ffffff;
    padding: 0.32rem 0.4rem;
}

.selected-order-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
    font-size: 0.77rem;
}

.selected-order-input {
    width: 100%;
    min-width: 8.7rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    padding: 0.22rem 0.35rem;
    font-size: 0.78rem;
}

.selected-order-actions {
    display: flex;
    gap: 0.28rem;
}

.order-button {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: #27364f;
    font-size: 0.68rem;
    border-radius: 0.35rem;
    padding: 0.16rem 0.35rem;
    cursor: pointer;
}

.order-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.order-button-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.stakeholder-control,
.logo-picker-control {
    display: grid;
    gap: 0.55rem;
}

.stakeholder-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
}

.secondary-button {
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.62rem 0.9rem;
    background: var(--bg-soft);
    color: #324463;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-button:hover:not(:disabled) {
    border-color: #b8c3d5;
    background: #ecf2fa;
}

.secondary-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.logo-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.logo-upload-input {
    display: none;
}

.logo-upload-label {
    display: inline-flex;
    align-items: center;
}

.logo-search-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.45rem;
}

.logo-page-button {
    min-width: 2.2rem;
}

.logo-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.55rem;
}

.logo-suggestion-tile {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: #ffffff;
    padding: 0.45rem;
    display: grid;
    gap: 0.32rem;
    cursor: pointer;
}

.logo-suggestion-tile.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.logo-suggestion-image {
    width: 100%;
    height: 48px;
    object-fit: contain;
    background: var(--bg-soft);
    border-radius: 0.35rem;
}

.logo-suggestion-title {
    font-size: 0.69rem;
    color: #334155;
    text-align: center;
    word-break: break-word;
}

.logo-selected-card {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: #ffffff;
    padding: 0.4rem 0.5rem;
}

.logo-selected-image {
    width: 64px;
    height: 32px;
    object-fit: contain;
}

.logo-selected-text {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.submit-button {
    border: none;
    border-radius: 0.72rem;
    padding: 0.7rem 1rem;
    background: #1c4b96;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-button:hover {
    background: #0d2f6e;
}

.icon {
    width: 1rem;
    height: 1rem;
}

.wizard-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.9rem 1.4rem;
}

.wizard-actions-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.wizard-actions-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.15rem;
}

.signed-out-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.6rem;
}

.signed-out-card p {
    color: var(--text-muted);
}

mark {
    background: #fde68a;
    color: inherit;
    padding: 0 0.1rem;
    border-radius: 0.2rem;
}

@media (max-width: 980px) {
    .wizard-layout {
        grid-template-columns: 1fr;
    }

    .wizard-nav-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
        gap: 0.8rem;
        padding: 1rem;
    }

    .wizard-nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard-step-button {
        min-height: 4.2rem;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    body {
        padding: 1rem 0.75rem;
    }

    .app-hero {
        padding: 0.78rem 0.82rem;
        border-radius: 1rem;
        grid-template-columns: 1fr;
    }

    .hero-logo {
        width: 3.4rem;
        height: 3.4rem;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .wizard-content-panel {
        padding: 1rem;
    }

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

    .form-group,
    .form-group.w-6,
    .form-group.w-4,
    .form-group.w-full {
        grid-column: span 1;
    }

    .wizard-nav-list {
        grid-template-columns: 1fr;
    }

    .logo-search-row {
        grid-template-columns: 1fr 1fr;
    }

    .logo-search-input {
        grid-column: span 2;
    }

    .wizard-actions {
        padding: 0.8rem 1rem;
    }

    .wizard-actions-right {
        width: 100%;
        justify-content: space-between;
    }
}
