/**
 * Partner business home: the Overview tab, the getting-started checklist and
 * the registration step indicator. See the "Business home" section of
 * app/partner.js.
 */

/* Switcher row above every signed-in state of the partner page */
.switcher-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.switcher-bar:has(#account-switcher[hidden]) { display: none; }

/* Big quick actions */
.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-action {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.9rem;
    row-gap: 0.15rem;
    align-items: center;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--background);
    color: var(--text-dark);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-action:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 18px var(--shadow);
    transform: translateY(-1px);
}

.home-action:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.home-action-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.home-action-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.home-action-primary .home-action-sub { color: rgba(255, 255, 255, 0.85); }

.home-action-icon {
    grid-row: 1 / span 2;
    font-size: 2rem;
    line-height: 1;
}

.home-action-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.home-action-sub {
    font-size: 0.88rem;
    color: var(--text-light);
}

.home-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.home-links a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.home-links a:hover { text-decoration: underline; }

/* Getting-started checklist */
.home-steps {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-bottom: 1.5rem;
}

.home-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-checklist li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.55rem 0;
}

.home-checklist li + li { border-top: 1px solid var(--border); }

.home-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.home-checklist li.is-done .home-check {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.home-checklist li.is-done .home-step-label { color: var(--text-light); }

.home-step-label { flex: 1; min-width: 12rem; }

.home-step-note { font-size: 0.83rem; color: var(--text-light); }

/* Campaign summary on the home tab */
.home-campaign-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-campaign {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.6rem 0;
}

.home-campaign + .home-campaign { border-top: 1px solid var(--border); }

.home-campaign-title { font-weight: 600; }

.home-campaign-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

/* Links styled as .btn-sm (deep links rather than buttons) */
.panel a.btn-sm { text-decoration: none; display: inline-block; }

/* Registration: where they are in the three steps */
.onboard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-light);
}

.onboard-steps li { display: flex; align-items: center; gap: 0.4rem; }

.onboard-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
}

.onboard-steps li.is-current { color: var(--text-dark); font-weight: 600; }

.onboard-steps li.is-current span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.register-footer {
    margin: 1.25rem 0 0;
    font-size: 0.88rem;
    color: var(--text-light);
}

.register-footer a { color: var(--primary-color); }

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

.gate-same-account { margin-top: -0.25rem; }

/* ── Loading panel ──────────────────────────────────────────────────────
   Shown from page load until getMyPartner answers. Uses .loading-spinner
   from styles.css. */
.portal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 45vh;
    text-align: center;
    gap: 0.25rem;
}

.portal-loading[hidden] {
    display: none;
}

.portal-loading-title {
    font-weight: 600;
    color: var(--text-dark, #1f2937);
    margin: 0;
}

.portal-loading-note {
    max-width: 32rem;
    margin: 0.25rem 0 0;
    color: var(--text-light, #6b7280);
    font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
    .portal-loading .loading-spinner {
        animation-duration: 3s;
    }
}
