.auth-channel-field {
    margin-bottom: 2px;
}

.auth-channel-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-subtle);
}

.auth-channel-option {
    min-width: 0;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.auth-channel-option:hover:not(:disabled) {
    color: var(--text);
}

.auth-channel-option.is-active {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
    color: var(--brand-strong);
    box-shadow: var(--shadow-sm);
}

.auth-channel-option:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.auth-channel-option:disabled {
    cursor: wait;
    opacity: 0.6;
}

[data-auth-target][hidden],
[data-reset-target][hidden],
[data-auth-captcha-step][hidden],
[data-verification-feedback][hidden] {
    display: none !important;
}

.auth-panel .auth-footer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    min-height: 22px;
    margin-top: 12px;
}

.auth-panel .auth-footer-row [data-auth-status] {
    min-width: 0;
    min-height: 18px;
    margin: 0;
    text-align: left;
}

.auth-panel .auth-forgot-link {
    align-self: end;
    justify-self: end;
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

.auth-panel .auth-forgot-link a {
    color: var(--brand-strong, var(--brand));
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.auth-panel .auth-forgot-link a:hover {
    text-decoration: underline;
}

.auth-panel .auth-forgot-link a:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.auth-panel .auth-forgot-link[hidden] {
    display: none !important;
}

.auth-verification-row {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}

.auth-verification-row input {
    min-width: 0;
    flex: 1 1 auto !important;
}

.auth-verification-row button {
    min-width: 104px;
    min-height: 42px;
    flex: 0 0 auto !important;
    white-space: nowrap;
}

.auth-verification-feedback {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.auth-verification-feedback.is-success {
    color: var(--success, #16835f);
}

.auth-verification-feedback.is-error {
    color: var(--danger, #d93025);
}

.auth-verification-feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.auth-verification-feedback-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.auth-verification-feedback-action:hover {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.auth-verification-feedback-action:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .auth-channel-option {
        min-height: 38px;
    }

    .auth-verification-row button {
        min-width: 96px;
        padding-inline: 10px;
    }
}

.profile-email-row,
.profile-email-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-email-row input,
.profile-email-code-row input {
    min-width: 0;
    flex: 1 1 auto;
}

.profile-email-row button,
.profile-email-code-row button {
    min-height: 42px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.profile-email-badge {
    display: inline-flex;
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.profile-email-badge.is-verified {
    color: var(--success);
}

.profile-email-bind-panel {
    display: grid;
    gap: 12px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.profile-email-bind-panel[hidden] {
    display: none !important;
}

.profile-email-captcha {
    width: 108px;
    height: 42px;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-subtle);
    cursor: pointer;
}

.profile-email-captcha img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
