/* firstrun.css — full-screen overlay for the post-install guided
   setup flow (mobile Phase 2c). Mounted by features/firstrun/index.js
   when /api/bootstrap returns `needs_first_run: true`. The overlay sits
   above the entire app — including the bottom nav — so the welcome /
   permissions / integrations / done screens are the only thing the user
   sees until they advance or skip.

   All visual values resolve through `--wg-*` design tokens (CLAUDE.md
   rule #3). No hardcoded colours, no inline styles in JS.
   `--z-modal` is the existing modal-layer token; we sit one step above
   it so a stale legacy modal can't render through the overlay. */

.wg-firstrun-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--wg-bg-stage);
    color: var(--wg-fg-1);
    font-family: var(--wg-font-ui);
    overflow-y: auto;
    animation: wg-firstrun-overlay-enter 0.2s ease;
}

.wg-firstrun-overlay__panel {
    flex: 1 1 auto;
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.wg-firstrun-overlay__title {
    margin: 0;
    font-family: var(--wg-font-mono);
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--wg-fg-1);
    letter-spacing: 0.01em;
}

.wg-firstrun-overlay__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

@keyframes wg-firstrun-overlay-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screen content — shared across welcome, permissions, integrations,
   done. Per-screen modules append their content into `.wg-firstrun-
   overlay__body`; the tagline + actions classes provide consistent
   typography and layout so the screens feel like one flow rather than
   four unrelated cards. */
.wg-firstrun-screen__tagline {
    margin: 0;
    color: var(--wg-fg-2);
    font-size: var(--font-size-md);
    line-height: 1.5;
}

.wg-firstrun-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.wg-firstrun-btn {
    appearance: none;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-family: var(--wg-font-ui);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
    min-height: 48px;
    line-height: 1.2;
}

.wg-firstrun-btn:active {
    transform: scale(0.98);
}

.wg-firstrun-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wg-firstrun-btn--primary {
    background: var(--wg-sun);
    color: var(--wg-ink);
}

.wg-firstrun-btn--secondary {
    background: transparent;
    color: var(--wg-fg-2);
    border: 1px solid var(--wg-border-strong);
}

/* Permission rows (Task 5) — one card per requestable capability. The
   "Allow" button shares the .wg-firstrun-btn styles above; granted/denied
   states are signalled by a leading-border colour change so the row label
   stays readable in both light and dark themes. All visual values resolve
   via design tokens (CLAUDE.md rule #3). */
.wg-firstrun-permissions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.wg-firstrun-permission {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--wg-border-strong);
    background: var(--wg-bg-surface);
}

.wg-firstrun-permission--granted {
    border-color: var(--wg-success, var(--wg-border-strong));
}

.wg-firstrun-permission--denied {
    border-color: var(--wg-warning, var(--wg-border-strong));
}

.wg-firstrun-permission__label {
    font-family: var(--wg-font-mono);
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--wg-fg-1);
}

.wg-firstrun-permission__copy {
    margin: 0;
    color: var(--wg-fg-2);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.wg-firstrun-permission__status {
    margin: 0;
    color: var(--wg-fg-2);
    font-size: var(--font-size-sm);
    line-height: 1.4;
    min-height: 0;
}

.wg-firstrun-permission__status:empty {
    display: none;
}

/* Integrations form (Task 6) — labelled inputs stacked vertically with
   a generous tap target. The inline error slot renders empty by default
   and surfaces a soft "save failed, try again or skip" message when a
   PATCH rejects so the user is never stranded on the screen. All visual
   values resolve via design tokens (CLAUDE.md rule #3). */
.wg-firstrun-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.wg-firstrun-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.wg-firstrun-field__label {
    font-family: var(--wg-font-mono);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--wg-fg-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wg-firstrun-field__input {
    appearance: none;
    border: 1px solid var(--wg-border-strong);
    background: var(--wg-bg-surface);
    color: var(--wg-fg-1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-family: var(--wg-font-ui);
    font-size: var(--font-size-md);
    line-height: 1.3;
    min-height: 48px;
}

.wg-firstrun-field__input:focus {
    outline: none;
    border-color: var(--wg-sun);
}

.wg-firstrun-form__error {
    margin: 0;
    color: var(--wg-warning, var(--wg-fg-2));
    font-size: var(--font-size-sm);
    line-height: 1.4;
    min-height: 0;
}

.wg-firstrun-form__error:empty {
    display: none;
}
