/* Email sign-in (EmailSignIn / EmailLinkConfirm). Shared by web and mobile, so colors fall back
   from the web login tokens (--ls-*) to the mobile tokens before using literals. Host pages may
   style .field / their button class with higher specificity; these rules are the baseline. */
.esi {
    --esi-brand: var(--ls-brand, var(--brand, #CC3929));
    --esi-link: var(--ls-brand, var(--brand-strong, #CC3929));
    --esi-text: var(--ls-text, var(--ink, #1A0F08));
    --esi-muted: var(--ls-text-muted, var(--muted, #8A7C6E));
    --esi-border: var(--ls-border, var(--line, #E4D8C3));
    --esi-danger: var(--ls-danger, var(--danger, #D8543F));
    display: flex;
    flex-direction: column;
    color: var(--esi-text);
}

.esi-hint {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--esi-text);
    overflow-wrap: anywhere;
}

.esi-email {
    font-weight: 700;
}

.esi-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.esi-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--esi-muted);
}

.esi-field input {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-bottom: 1px solid var(--esi-border);
    border-radius: 0;
    padding: 8px 2px;
    font-size: 16px;
    color: var(--esi-text);
    background: transparent;
    outline: none;
}

.esi-field input:focus {
    border-color: var(--esi-brand);
}

.esi .esi-field input.esi-code {
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .45em;
}

.esi-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--esi-muted);
}

.esi-error,
.esi-notice {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--esi-danger);
    font-size: 13px;
    line-height: 1.5;
    color: var(--esi-danger);
    overflow-wrap: anywhere;
}

.esi-notice {
    border-left-color: var(--esi-brand);
    color: var(--esi-text);
}

.esi-link {
    border: 0;
    background: none;
    padding: 6px 2px;
    min-height: 32px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--esi-link);
    cursor: pointer;
}

.esi-link:disabled {
    opacity: .6;
    cursor: default;
}

.esi-resend {
    display: flex;
    justify-content: center;
    min-height: 44px;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: var(--esi-muted);
}

.esi-cancel {
    align-self: center;
    margin-top: 4px;
}

.esi-primary {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: var(--esi-brand);
    color: #FFFFFF;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.esi-primary:disabled {
    opacity: .7;
    cursor: default;
}

.esi-secondary {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--esi-border);
    border-radius: 8px;
    background: transparent;
    color: var(--esi-text);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.esi-secondary:hover:not(:disabled) {
    border-color: var(--esi-brand);
}

.esi-secondary:disabled {
    opacity: .7;
    cursor: default;
}

/* Standalone magic-link page */
.esi-page {
    min-height: 100vh;
}

.esi-standalone {
    max-width: 420px;
    margin: 0 auto;
    padding: 12vh 16px 40px;
}

.esi-standalone h1 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 800;
}

.esi-option {
    display: flex;
    justify-content: center;
    margin: 4px 0 18px;
}

/* Passkeys (PasskeySignIn / PasskeySettings) */
.pk-signin {
    margin-bottom: 4px;
}

.pk-signin-error {
    margin: 12px 0 0;
}

.pk-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    border-top: 1px solid var(--esi-border);
}

.pk-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--esi-border);
}

.pk-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 200px;
}

.pk-name {
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pk-actions {
    display: flex;
    gap: 8px;
}

.pk-rename {
    flex: 1 1 200px;
    margin-bottom: 0;
}

.pk-confirm {
    flex: 1 1 100%;
    margin: 0;
}

.esi-link.pk-danger {
    color: var(--esi-danger);
}

.pk-empty {
    margin: 0 0 18px;
}
