/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.1rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.25rem;
    position: relative;
    min-height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 0.25rem;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    justify-self: center;
    grid-column: 2;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.header h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 0.95rem;
    opacity: 0.85;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Main Container */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem;
}

/* Dashboard layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.steps-rail {
    display: none;
}

/* Welcome Section */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-content {
    position: relative;
    z-index: 2;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    font-family: 'Fraunces', Georgia, serif;
}

.welcome-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
}

.welcome-decoration {
    position: relative;
    z-index: 2;
}

.welcome-icon {
    opacity: 0.3;
    stroke: white;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.welcome-section::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 1;
}

/* Launchpad Header */
.launchpad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.06) 0%, rgba(26, 54, 93, 0.02) 100%);
    border-radius: 20px;
    border: 1px solid rgba(26, 54, 93, 0.08);
    position: relative;
    overflow: hidden;
}

.launchpad-header-content {
    position: relative;
    z-index: 2;
}

.launchpad-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

.launchpad-header h2 {
    font-size: 1.6rem;
    margin: 0.35rem 0;
    color: var(--primary-dark);
}

.launchpad-subtitle {
    color: var(--text-muted);
    max-width: 52ch;
}

.launchpad-decoration {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(26, 54, 93, 0.1);
}

.decoration-circle-1 {
    width: 120px;
    height: 120px;
    right: 0;
    top: -60px;
}

.decoration-circle-2 {
    width: 80px;
    height: 80px;
    right: 60px;
    top: -20px;
    border-color: rgba(201, 162, 39, 0.2);
}

.decoration-circle-3 {
    width: 40px;
    height: 40px;
    right: 20px;
    top: 20px;
    background: rgba(201, 162, 39, 0.1);
    border: none;
}

.launchpad-search {
    min-width: 420px;
}

.tile-grid {
    display: grid;
    gap: 1rem;
    grid-auto-flow: dense;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    --tile-unit: 160px;
    grid-auto-rows: var(--tile-unit, 160px);
}

.tile {
    background: var(--bg-card);
    border: 1px solid rgba(15, 41, 66, 0.14);
    border-radius: 18px;
    box-shadow: 0 14px 30px -24px rgba(15, 41, 66, 0.7), var(--shadow);
    padding: 1.4rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    text-align: left;
    color: var(--text);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tile:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.tile:hover {
    transform: translateY(-2px);
    border-color: rgba(26, 54, 93, 0.32);
    box-shadow: 0 22px 36px -26px rgba(15, 41, 66, 0.8), var(--shadow-lg);
}

.tile-primary {
    border-color: rgba(26, 54, 93, 0.2);
    background: #ffffff;
    position: relative;
    border-left: 4px solid var(--primary);
}

.tile-primary:hover {
    border-color: var(--primary);
    box-shadow: 0 22px 36px -26px rgba(15, 41, 66, 0.8), 0 0 0 3px rgba(26, 54, 93, 0.08);
}

.tile-primary:hover .tile-icon {
    transform: scale(1.05);
}

.tile-primary:hover .tile-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.tile-arrow {
    margin-left: auto;
    opacity: 0.4;
    transition: transform 0.2s ease, opacity 0.2s ease;
    color: var(--primary);
    flex-shrink: 0;
}

.tile-muted {
    opacity: 0.6;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.04), rgba(26, 54, 93, 0.0));
    border-left: 4px solid var(--border);
}

.tile-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 18px -10px rgba(15, 41, 66, 0.8);
    transition: transform 0.2s ease;
}

.tile-icon svg {
    stroke: white;
}

.tile-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.tile-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.tile-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: var(--accent);
    color: var(--primary-dark);
}

.badge-muted {
    background: var(--border);
    color: var(--text-muted);
}

.tile-1u { grid-column: span 1; grid-row: span 1; }
.tile-2u { grid-column: span 2; grid-row: span 1; }
.tile-3u { grid-column: span 3; grid-row: span 1; }
.tile-4u { grid-column: 1 / -1; grid-row: span 1; }

.steps-summary-card .card-header {
    padding: 0.85rem 1rem;
}

.steps-summary-card .card-body {
    padding: 1rem;
}

.steps-summary-card h2 {
    font-size: 0.95rem;
}

.steps-summary-card .card-body {
    display: grid;
    gap: 0.75rem;
}

.steps-checklist {
    display: grid;
    gap: 0.5rem;
}

.steps-checklist-item {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 0.5rem;
    align-items: start;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    opacity: 0.55;
}

.steps-checklist-item.is-active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.steps-checklist-item.is-complete {
    opacity: 1;
    border-color: rgba(5, 150, 105, 0.4);
    background: rgba(5, 150, 105, 0.08);
}

.steps-checklist-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    margin-top: 0.2rem;
}

.steps-checklist-item.is-active .steps-checklist-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2);
}

.steps-checklist-item.is-complete .steps-checklist-dot {
    background: var(--success);
}

.steps-checklist-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.steps-checklist-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Steps grid */
.steps-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header .card-action {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

.card-header .card-action:hover {
    background: rgba(255, 255, 255, 0.22);
}

.card-header-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.card-header .step-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
}

.card-body {
    padding: 1.25rem;
}

.auth-card {
    margin-top: 1rem;
}

#auth-shell {
    max-width: 420px;
    margin: 3rem auto;
    flex: 1 0 auto;
}

#app-shell {
    flex: 1 0 auto;
    padding-bottom: 1.5rem;
}

#auth-shell .card {
    margin-bottom: 0;
}

.auth-help {
    margin-top: 1rem;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-muted);
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem 0.5rem;
}

.page-toolbar h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-color: var(--border);
    background: var(--bg);
    color: var(--text);
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: auto;
}

.footer-logo-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.footer-logo-item:hover {
    transform: scale(1.1);
}

.footer-logo-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--primary-dark);
    color: white;
    font-size: 0.7rem;
    border-radius: 6px;
    white-space: pre-line;
    text-align: center;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: var(--shadow-lg);
    min-width: max-content;
}

.footer-logo-item[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--primary-dark);
    margin-bottom: -4px;
    z-index: 100;
}

body > [data-include="partials/footer.html"] {
    margin-top: auto;
    width: 100%;
}

.footer-image,
.footer-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
}

/* Progress indicator */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.progress-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
}

.progress-step.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

.progress-step.completed {
    background: var(--success);
}

/* Responsive */
@media (min-width: 640px) {
    .launchpad-search {
        min-width: 420px;
    }

    .container {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1.5rem;
    }
}

@media (min-width: 900px) {
    .footer {
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    .header {
        padding-left: 1rem;
        margin-left: var(--nav-width);
        width: calc(100% - var(--nav-width));
        transition: margin-left 0.25s ease, width 0.25s ease;
    }

    .header-top {
        padding: 0 1.25rem;
    }

    .header-title {
        position: relative;
        align-items: center;
        text-align: center;
    }

    .header-left {
        position: relative;
    }

    .header-actions {
        position: relative;
    }

    #app-shell {
        padding-left: var(--nav-width);
        transition: padding-left 0.25s ease;
    }

    .footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        margin-left: var(--nav-width);
        width: calc(100% - var(--nav-width));
        transition: margin-left 0.25s ease, width 0.25s ease;
    }

    .footer-info-pill {
        margin-left: 0;
    }

    body.nav-collapsed .header,
    body.nav-collapsed #app-shell,
    body.nav-collapsed .footer {
        margin-left: 0;
        width: 100%;
    }

    body.nav-collapsed #app-shell {
        padding-left: 0;
    }


    body.nav-collapsed .footer-info-pill {
        margin-left: 0.5rem;
    }

    .container {
        max-width: 1320px;
        padding: 2rem;
    }

    .progress-steps {
        display: none;
    }

    .reset-bar {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) 240px;
        align-items: start;
    }

    .steps-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .steps-grid .card {
        margin-bottom: 0;
    }

    .steps-rail {
        display: block;
        position: sticky;
        top: 96px;
        max-width: 240px;
    }
}

@media (max-width: 520px) {
    .header-top {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header-left,
    .header-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .header-actions {
        justify-content: center;
    }

    .card-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .card-header h2 {
        flex: 1 1 100%;
    }

    .card-header-actions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .card-header .step-badge {
        margin-left: 0;
    }
}

body.is-unauthenticated .header-top {
    grid-template-columns: 1fr auto 1fr;
    display: flex;
    justify-content: center;
}

body.is-unauthenticated .header-left,
body.is-unauthenticated .header-actions {
    display: none;
}

body.is-unauthenticated .header {
    text-align: center;
    margin-left: 0;
    width: 100%;
}

body.is-unauthenticated .header-title {
    justify-self: center;
    grid-column: auto;
}

body.is-unauthenticated .footer {
    padding: 1.5rem;
    text-align: center;
    margin-left: 0;
    width: 100%;
}

@media (max-width: 900px) {
    .launchpad-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

}

@media (max-width: 640px) {
    .tile-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .tile-4u,
    .tile-3u,
    .tile-2u,
    .tile-1u {
        grid-column: span 1;
        grid-row: span 1;
    }

    .welcome-section {
        padding: 1.25rem 1.5rem;
    }

    .welcome-title {
        font-size: 1.25rem;
    }

    .welcome-icon {
        width: 48px;
        height: 48px;
    }

    .launchpad-header {
        padding: 1.25rem 1.5rem;
    }

    .launchpad-header h2 {
        font-size: 1.3rem;
    }

    .launchpad-decoration {
        display: none;
    }

    .tile-arrow {
        display: none;
    }
}


