/* =============================================================================
   Invite-request modal — animated open/close
   The modal stays in the DOM at all times; toggling .open animates the
   backdrop blur + tint and the card scale/fade.
   ============================================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-24);
    pointer-events: none;
}
.modal.open { pointer-events: auto; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: background 0.4s ease,
                backdrop-filter 0.4s ease,
                -webkit-backdrop-filter 0.4s ease;
}
.modal.open .modal-backdrop {
    background: var(--color-overlay-dim);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    background: var(--color-card);
    border-radius: var(--radius-card);
    padding: var(--spacing-32);
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow-modal);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity var(--transition-normal),
                transform var(--transition-smooth);
}
.modal.open .modal-card { opacity: 1; transform: scale(1); }

.modal-card h2 {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-heading);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 var(--spacing-small);
}

#invite-body {
    margin: 0 0 var(--spacing-32);
    color: var(--color-muted);
    font-size: var(--font-size-body);
    line-height: 1.5;
}
/* Once the form is hidden (success state), drop body's bottom margin so the
   card's own padding is the only spacing below. */
.modal.success #invite-body { margin-bottom: 0; }

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: 50%;
}
.modal-close:hover {
    background: color-mix(in oklab, var(--color-muted) 15%, transparent);
    color: var(--color-text);
}

#invite-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#invite-form[hidden] { display: none; }

#invite-phone {
    padding: 14px var(--spacing-16);
    border: 1px solid color-mix(in oklab, var(--color-muted) 30%, transparent);
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-family: var(--font-family-sans);
    background: var(--color-background);
    color: var(--color-text);
    width: 100%;
}
#invite-phone:focus {
    outline: none;
    border-color: var(--color-accent);
}

.cta-submit {
    border: 0;
    width: 100%;
    cursor: pointer;
    font-family: var(--font-family-sans);
}
.cta-submit:disabled { opacity: 0.6; cursor: default; }

.invite-body-error { color: var(--color-error); }

.modal-fineprint {
    margin: var(--spacing-32) 0 0;
    font-size: var(--font-size-small);
    text-align: center;
    color: var(--color-muted);
}
.modal-fineprint a       { color: var(--color-muted); text-decoration: underline; }
.modal-fineprint a:hover { color: var(--color-text); }
