/* Column layout for stacked inputs */
.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: none;
}

/* Field block: label + control */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.field-label {
    font-weight: var(--fw-semibold);
    color: var(--control-fg);
    opacity: .9;
}

/* Make inputs fill the column nicely */
.field input,
.field select,
.field textarea {
    width: 100%;
}

/* Action row keeps your existing spacing but aligns to start */
.row.actions {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 8px;
}

/* center panel horizontally */
.panel {
    max-width: 400px;
    margin: 0 auto;
    /* centers it */
}

/* center the heading */
h2 {
    text-align: center;
    margin-bottom: 16px;
    /* some breathing room above panel */
}

/* === LOGIN: tiny "Forgot password?" button ========================== */
button.forget-pass {
    border: 0;
    color: var(--ghost-fg);
    /* neutral text, not yellow */
    font: inherit;
    font-size: 0.875rem;
    /* ~14px */
    line-height: 1.2;

    /* keep it narrow (no full-width stretching) */
    display: inline-flex;
    width: auto;
    max-width: max-content;
    flex: 0 0 auto;
    /* resist flex:1 parents */
    align-self: flex-start;
    /* resist stretch in flex parents */
    justify-self: start;
    /* resist stretch in grid parents */
    white-space: nowrap;

    padding: 2px 4px;
    /* small hit area for focus */
    margin-top: 6px;
    border-radius: 6px;
    cursor: pointer;
    filter: none;
    /* cancel global hover brightness */
}

/* hover = subtle link vibe, still not yellow */
button.forget-pass:hover,
button.forget-pass:active {
    color: var(--brand);
    text-decoration: underline;
    filter: none;
}

/* accessible focus ring, not yellow */
button.forget-pass:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Fix header layout for restore modal */
.modal-header {
    display: flex;
    align-items: center;
    /* keep title & button aligned vertically */
    gap: 8px;
}

.modal-title {
    flex: 1 1 auto;
    /* title takes the available space */
}

.modal-close {
    margin-left: auto;
    /* shove the button to the far right */
    flex: 0 0 auto;
    width: auto;
    /* in case some global rule makes buttons 100% width */
    display: inline-flex;
    align-items: center;
}

/* Only the restore modal width */
#restore-modal .modal--narrow {
    width: clamp(320px, 92vw, 520px);
    /* desktop ≈520px, mobile ≈full width */
    box-sizing: border-box;
}