/*
 * DEEPTASK member account card and shortcode.
 * 100% var(--deeptask-*) tokens. Zero hard-coded colors. Zero icons.
 */

.dt-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: var(--deeptask-viewport-inset);
    background: var(--deeptask-color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.dt-auth-card {
    width: min(480px, 100%);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: clamp(16px, 2.6vh, 26px) clamp(18px, 4vw, 28px) clamp(14px, 2vh, 20px);
    border: 1px solid var(--deeptask-card-border);
    border-radius: var(--deeptask-radius-lg);
    background: var(--deeptask-card-bg);
    box-shadow: var(--deeptask-shadow-md);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.8vh, 18px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    box-sizing: border-box;
}

.dt-auth-card::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.dt-auth-card__brand {
    font-size: var(--deeptask-font-size);
    font-family: var(--deeptask-font-emphasis);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--deeptask-color-primary);
}

.deeptask-scope .dt-auth-card .dt-auth-card__title {
    margin: 0;
    font-family: var(--deeptask-font-emphasis) !important;
    font-size: var(--deeptask-font-size) !important;
    font-weight: 400 !important;
    line-height: 1.35;
    text-transform: uppercase !important;
    color: var(--deeptask-color-text) !important;
}

.dt-auth-card__desc {
    font-size: var(--deeptask-font-size);
    color: var(--deeptask-color-text-muted);
}

.dt-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color-scheme: var(--deeptask-color-scheme);
}

.deeptask-scope .dt-auth-form input.dt-input:is(:autofill, :-webkit-autofill) {
    -webkit-text-fill-color: var(--deeptask-color-text);
    caret-color: var(--deeptask-color-text);
    box-shadow: inset 0 0 0 100px var(--deeptask-color-input-bg) !important;
    transition: none;
}

/* Keep the floating outline above the browser-painted autofill background. */
.deeptask-scope .dt-auth-form .dt-input-outline {
    z-index: 2;
}

.dt-auth-username {
    position: relative;
}

.deeptask-scope .dt-auth-username input.dt-input {
    padding-inline-end: 40px;
}

.dt-auth-username__indicator {
    position: absolute;
    z-index: 3;
    inset-block-start: calc(var(--deeptask-control-height) / 2);
    inset-inline-end: 13px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
}

.dt-auth-username__indicator::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.dt-auth-username__indicator[data-state="available"] {
    color: var(--deeptask-color-success);
}

.dt-auth-username__indicator:is([data-state="invalid"], [data-state="error"]) {
    color: var(--deeptask-color-danger);
}

.dt-auth-username__indicator[data-state="checking"] {
    color: var(--deeptask-color-text-muted);
}

.dt-auth-username__indicator[data-state="checking"]::before {
    width: 16px;
    height: 16px;
    mask: url('../assets/username-spinner.svg') center / contain no-repeat;
    animation: dt-auth-username-spin 800ms linear infinite;
}

@keyframes dt-auth-username-spin {
    to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
    .dt-auth-username__indicator[data-state="checking"]::before {
        animation: none;
    }
}

.dt-auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding-top: 16px;
    padding-bottom: 0;
    border-top: 1px solid var(--deeptask-color-border);
    font-size: var(--deeptask-font-size);
    line-height: 1.4;
}

.dt-auth-embed {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
}

.dt-auth-embed--portal {
    box-sizing: border-box;
}

body:not(.dt-auth-page) .dt-auth-embed--portal {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: clamp(12px, 2vh, 24px);
    padding-bottom: clamp(48px, 7vh, 72px);
}

.dt-auth-card--tabbed {
    gap: clamp(12px, 1.8vh, 18px);
    padding: clamp(16px, 2.6vh, 26px) clamp(18px, 4vw, 28px) clamp(14px, 2vh, 20px);
}

@media (max-width: 767px) {
    .dt-auth-page {
        align-items: flex-start;
        padding: 12px 10px;
    }

    .dt-auth-embed--portal {
        align-items: flex-start;
        padding-inline: 0;
    }

    body:not(.dt-auth-page) .dt-auth-embed--portal {
        width: min(480px, calc(100vw - 20px));
        margin-inline: calc(50% - min(240px, 50vw - 10px));
        padding-top: 12px;
        padding-bottom: 24px;
    }

    .dt-auth-embed--portal .dt-auth-card {
        width: 100%;
    }
}

@media (max-height: 860px) {
    .dt-auth-card,
    .dt-auth-card--tabbed,
    .dt-auth-card--status {
        --deeptask-control-height: 38px;
        --deeptask-input-height: 38px;
        --deeptask-button-height: 38px;
        gap: 10px;
        padding: 14px clamp(16px, 3vw, 24px) 12px;
    }

    .deeptask-scope .dt-auth-tabs .dt-auth-tab {
        min-height: 36px;
    }

    .dt-auth-panel {
        gap: 10px;
    }

    .dt-auth-form {
        gap: 10px;
    }

    .dt-auth-form__fields {
        gap: 9px;
    }

    .dt-auth-links {
        min-height: 36px;
        padding-top: 10px;
    }

    .dt-auth-links__note,
    .deeptask-scope .dt-auth-links .dt-auth-switch {
        min-height: 24px;
    }
}

@media (max-height: 700px) {
    .dt-auth-card,
    .dt-auth-card--tabbed,
    .dt-auth-card--status {
        --deeptask-control-height: 36px;
        --deeptask-input-height: 36px;
        --deeptask-button-height: 36px;
        gap: 8px;
        padding: 12px clamp(14px, 3vw, 20px) 10px;
    }

    .dt-auth-panel {
        gap: 8px;
    }

    .dt-auth-panel__intro {
        gap: 4px;
    }

    .dt-auth-card__desc {
        font-size: var(--deeptask-font-size);
        line-height: 1.35;
    }

    .dt-auth-form,
    .dt-auth-form__fields {
        gap: 8px;
    }

    .dt-auth-links {
        min-height: 32px;
        padding-top: 8px;
    }
}

.dt-auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--deeptask-color-border);
    border-radius: 50px;
    background: var(--deeptask-color-inset);
}

.dt-auth-tabs::before {
    content: '';
    position: absolute;
    z-index: 0;
    inset-block: 10px;
    inset-inline-start: 10px;
    width: calc((100% - 28px) / 2);
    box-sizing: border-box;
    border: 1px solid var(--deeptask-color-glass-border-active);
    border-radius: 40px;
    background: var(--deeptask-color-panel);
    box-shadow: var(--deeptask-shadow-sm);
    pointer-events: none;
    transform: translateX(0);
    opacity: 1;
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
    will-change: transform;
}

.dt-auth-card[data-dt-auth-mode="register"] .dt-auth-tabs::before {
    transform: translateX(calc(100% + 8px));
}

.dt-auth-card[data-dt-auth-mode="forgot"] .dt-auth-tabs::before {
    transform: translateX(0);
    opacity: 0;
}

.dt-auth-card[data-dt-auth-mode="registered"] .dt-auth-tabs::before {
    transform: translateX(calc(100% + 8px));
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .dt-auth-tabs::before {
        transition: none;
    }
}

.deeptask-scope .dt-auth-tabs .dt-auth-tab {
    position: relative;
    z-index: 1;
    appearance: none;
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 6px 12px;
    border: 1px solid var(--deeptask-color-transparent);
    border-radius: 40px;
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-text-muted);
    font-family: var(--deeptask-font-emphasis);
    font-size: var(--deeptask-font-size);
    font-weight: 400;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
    cursor: pointer;
    transition: color 220ms ease;
}

.deeptask-scope .dt-auth-tabs .dt-auth-tab:hover {
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-text);
}

.deeptask-scope .dt-auth-tabs .dt-auth-tab[aria-selected="true"] {
    border-color: var(--deeptask-color-transparent);
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-primary-ink);
    font-family: var(--deeptask-font-emphasis);
    font-size: var(--deeptask-font-size);
    font-weight: 400;
}

.dt-auth-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

/* Both panels size the same grid row, including when the inactive panel is invisible. */
.dt-auth-panel {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dt-auth-panel[aria-hidden="true"] {
    visibility: hidden;
}

.dt-auth-panel[data-dt-auth-panel="forgot"][aria-hidden="true"],
.dt-auth-panel[data-dt-auth-panel="registered"][aria-hidden="true"] {
    display: none;
}

.dt-auth-panel__intro {
    display: grid;
    gap: 6px;
}

.dt-auth-form__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dt-auth-panel > .dt-auth-links {
    margin-top: auto;
}

.dt-auth-password {
    position: relative;
}

.deeptask-scope .dt-auth-password input.dt-input {
    padding-inline-end: var(--deeptask-control-height);
}

.deeptask-scope .dt-auth-password__toggle {
    appearance: none;
    position: absolute;
    z-index: 3;
    inset-block-start: calc(var(--deeptask-control-height) / 2);
    inset-inline-end: 0;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: var(--deeptask-control-height);
    height: var(--deeptask-control-height);
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--deeptask-radius-sm);
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-text-muted);
    cursor: pointer;
    transition: color 160ms ease;
}

.deeptask-scope .dt-auth-password__toggle:hover,
.deeptask-scope .dt-auth-password__toggle:focus-visible,
.deeptask-scope .dt-auth-password__toggle:active {
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-text);
}

.deeptask-scope .dt-auth-password__toggle:focus-visible {
    outline: 2px solid var(--deeptask-color-primary);
    outline-offset: -3px;
}

.deeptask-scope .dt-auth-password__toggle::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url('../assets/eye-hidden.svg') center / contain no-repeat;
    mask: url('../assets/eye-hidden.svg') center / contain no-repeat;
}

.deeptask-scope .dt-auth-password__toggle[aria-pressed="true"]::before {
    -webkit-mask-image: url('../assets/eye-visible.svg');
    mask-image: url('../assets/eye-visible.svg');
}

.dt-auth-links--center {
    justify-content: center;
    text-align: center;
}

.dt-auth-links--note {
    justify-content: center;
    text-align: center;
    color: var(--deeptask-color-text-muted);
}

.dt-auth-links__note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 0;
    line-height: 1.4;
}

.deeptask-scope .dt-auth-links .dt-auth-switch {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 0;
    border: 0;
    padding: 0;
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-primary-ink);
    font-family: var(--deeptask-font-emphasis);
    font-size: inherit;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
}

.deeptask-scope .dt-auth-links .dt-auth-switch:hover,
.deeptask-scope .dt-auth-links .dt-auth-switch:focus-visible,
.deeptask-scope .dt-auth-links .dt-auth-switch:active {
    background: var(--deeptask-color-transparent);
    box-shadow: none;
    color: var(--deeptask-color-primary-ink);
    text-decoration: underline;
}

/* Pending approval & member status layout */
.dt-auth-card--status {
    gap: 18px;
    padding: clamp(18px, 4vw, 28px) clamp(18px, 4vw, 28px) clamp(16px, 3vw, 20px);
}

.dt-auth-status-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dt-auth-status-head {
    display: flex;
    align-items: center;
}

.dt-auth-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--deeptask-color-border);
    border-radius: var(--deeptask-radius-pill);
    background: var(--deeptask-color-inset);
    color: var(--deeptask-color-text);
    font-family: var(--deeptask-font-emphasis);
    font-size: var(--deeptask-font-size);
    line-height: 1.2;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.dt-auth-status-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.dt-auth-status-badge--pending {
    border-color: var(--deeptask-color-warning-soft);
    background: var(--deeptask-color-warning-surface);
    color: var(--deeptask-color-warning);
}

.dt-auth-status-badge--waiting {
    border-color: var(--deeptask-color-primary-tint);
    background: var(--deeptask-color-primary-soft);
    color: var(--deeptask-color-primary-ink);
}

.dt-auth-status-badge--suspended {
    border-color: var(--deeptask-color-danger-soft);
    background: var(--deeptask-color-danger-surface);
    color: var(--deeptask-color-danger);
}

.dt-auth-status-badge--approved {
    border-color: var(--deeptask-color-success-soft);
    background: var(--deeptask-color-success-surface);
    color: var(--deeptask-color-success);
}

.dt-auth-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 16px 12px;
    list-style: none;
    border: 1px solid var(--deeptask-color-border);
    border-radius: var(--deeptask-radius);
    background: var(--deeptask-color-inset);
}

.dt-auth-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.dt-auth-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 7px;
    left: calc(50% + 12px);
    width: calc(100% - 16px);
    height: 2px;
    background: var(--deeptask-step-line);
}

.dt-auth-step.is-done:not(:last-child)::after {
    background: var(--deeptask-step-line-done);
}

.dt-auth-step__dot {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--deeptask-step-pending);
    background: var(--deeptask-color-panel);
}

.dt-auth-step.is-done .dt-auth-step__dot {
    border-color: var(--deeptask-step-done);
    background: var(--deeptask-step-done);
}

.dt-auth-step.is-active .dt-auth-step__dot {
    border-color: var(--deeptask-step-active);
    background: var(--deeptask-step-active);
    box-shadow: 0 0 0 4px var(--deeptask-step-active-ring);
}

.dt-auth-step__label {
    font-size: var(--deeptask-font-size);
    line-height: 1.3;
    color: var(--deeptask-step-text-pending);
}

.dt-auth-step.is-done .dt-auth-step__label,
.dt-auth-step.is-active .dt-auth-step__label {
    color: var(--deeptask-step-text-done);
    font-family: var(--deeptask-font-emphasis);
}

.dt-auth-summary {
    margin: 0;
    padding: 4px 16px;
    border: 1px solid var(--deeptask-color-border);
    border-radius: var(--deeptask-radius);
    background: var(--deeptask-color-inset);
    display: flex;
    flex-direction: column;
}

.dt-auth-summary__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.dt-auth-summary__row + .dt-auth-summary__row {
    border-top: 1px solid var(--deeptask-color-border);
}

.dt-auth-summary__label {
    margin: 0;
    font-size: var(--deeptask-font-size);
    color: var(--deeptask-color-text-muted);
    flex-shrink: 0;
}

.dt-auth-summary__value {
    margin: 0;
    font-size: var(--deeptask-font-size);
    font-family: var(--deeptask-font-emphasis);
    color: var(--deeptask-color-text);
    text-align: right;
    overflow-wrap: anywhere;
}

.dt-auth-summary__value--pending {
    color: var(--deeptask-color-warning);
}

.dt-auth-summary__value--waiting {
    color: var(--deeptask-color-primary-ink);
}

.dt-auth-summary__value--suspended {
    color: var(--deeptask-color-danger);
}

.dt-auth-summary__value--approved {
    color: var(--deeptask-color-success);
}

.dt-auth-status-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dt-auth-status-actions .dt-btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 420px) {
    .dt-auth-summary__row {
        flex-direction: column;
        gap: 2px;
    }

    .dt-auth-summary__value {
        text-align: left;
    }
}
