/* ==========================================================================
   Auth Page Shared Styles (Login, Register, VerifyOtp, SetupPasskey)
   ========================================================================== */

.hh-auth-page {
    min-height: calc(100svh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: transparent;
}

.hh-auth-container {
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hh-auth-wide {
    max-width: 580px;
}

.hh-auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hh-auth-logo-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--hh-surface-soft-alt);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hh-glass-border);
    box-shadow: var(--hh-shadow-sm);
}

.hh-auth-logo {
    font-size: 3rem;
}

.hh-auth-logo-brand {
    width: 52px;
    height: 52px;
    object-fit: contain;
    display: block;
    filter: none;
}

.hh-auth-symbol-badge {
    display: block;
    object-fit: contain;
    filter: none;
}

.hh-auth-symbol-badge-passkey {
    width: 58px;
    height: 58px;
}

.hh-auth-symbol-badge-login {
    width: 60px;
    height: 60px;
}

.hh-auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hh-auth-subtitle {
    color: var(--hh-text-secondary);
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
}

.hh-auth-card {
    padding: 1.75rem 1.2rem;
}

.hh-auth-guidance {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--hh-glass-border-highlight);
    background: var(--hh-surface-soft-alt);
    color: var(--hh-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.hh-auth-guidance--soft {
    background: rgba(var(--hh-primary-rgb), 0.1);
    border-color: rgba(var(--hh-primary-rgb), 0.26);
}

.hh-auth-progress-copy {
    margin: -1.4rem 0 1.1rem;
    text-align: center;
    color: var(--hh-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.hh-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hh-auth-form--register {
    gap: 1.1rem;
}

.hh-auth-helper {
    margin: 0;
    text-align: center;
    color: var(--hh-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.hh-auth-tertiary {
    opacity: 0.88;
}

.hh-auth-tertiary:hover {
    opacity: 1;
    background: var(--hh-surface-soft-alt);
}

.hh-auth-success {
    text-align: center;
    padding: 2rem 0;
}

.hh-auth-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    position: relative;
}

.hh-auth-separator::before,
.hh-auth-separator::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--hh-glass-border);
}

.hh-auth-separator span {
    padding: 0 1rem;
    color: var(--hh-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hh-auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@media (max-width: 420px) {
    .hh-auth-footer {
        flex-direction: column;
        gap: 0.1rem;
        text-align: center;
    }
}

.hh-submit-btn {
    padding: 1rem !important;
    font-weight: 700 !important;
    text-transform: none;
    letter-spacing: 0.01em;
}

.hh-passkey-btn {
    padding: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    text-transform: none;
}

.input-modern-wrapper .mud-input-outlined-border {
    border-color: var(--hh-glass-border) !important;
}

.input-modern-wrapper:focus-within .mud-input-outlined-border {
    border-color: var(--hh-primary) !important;
}

/* --------------------------------------------------------------------------
   Registration Step Indicator
   -------------------------------------------------------------------------- */
.hh-auth-page .hh-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    gap: 0.5rem;
    overflow-x: hidden;
    padding: 0;
    transform: scale(0.9);
    transform-origin: center;
    max-width: 100vw;
}

.hh-auth-page .hh-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    cursor: default;
}

.hh-auth-page .hh-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hh-surface-soft-alt);
    border: 1px solid var(--hh-glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.hh-auth-page .hh-step.active .hh-step-number {
    background: var(--hh-primary);
    border-color: transparent;
    color: var(--hh-text-inverse);
}

.hh-auth-page .hh-step.completed .hh-step-number {
    background: rgba(var(--hh-success-rgb), 0.2);
    border-color: var(--hh-success);
    color: var(--hh-success);
}

.hh-auth-page .hh-step-label {
    font-size: 0.75rem;
    color: var(--hh-text-muted);
    letter-spacing: 0.01em;
    font-weight: 600;
    white-space: nowrap;
}

/* Prevent long step labels from overflowing when other page styles style .hh-step as cards. */
.hh-auth-page .hh-step-label {
    display: -webkit-box;
    max-width: 100%;
    min-height: 2.4em;
    max-height: 2.4em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
    line-height: 1.2;
}

.hh-auth-page .hh-step.active .hh-step-label {
    color: var(--hh-text-primary);
}

.hh-auth-page .hh-step.completed .hh-step-label {
    color: var(--hh-success);
}

.hh-auth-page .hh-step-line {
    width: 40px;
    height: 1px;
    background: var(--hh-glass-border);
    margin-bottom: 1.25rem;
}

.hh-auth-page .hh-step-line.active {
    background: var(--hh-gradient-primary);
}

.hh-auth-page .hh-step-line.completed {
    background: var(--hh-success);
}

/* --------------------------------------------------------------------------
   Auth Page Form Layout
   -------------------------------------------------------------------------- */
.hh-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.hh-form-field.full-width {
    grid-column: 1 / -1;
}

/* Auth-specific Passkey Setup */
.hh-passkey-info {
    text-align: center;
    margin-bottom: 2rem;
}

.hh-passkey-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    background: rgba(var(--hh-primary-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--hh-primary-rgb), 0.2);
}

.hh-passkey-text {
    color: var(--hh-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* OTP Input */
.hh-otp-input-wrapper {
    text-align: center;
}

.hh-resend-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hh-glass-border);
}

.hh-auth-email-strong {
    color: var(--hh-text-primary);
}

/* --------------------------------------------------------------------------
   Login Success Overlay
   -------------------------------------------------------------------------- */
.hh-login-success-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--hh-z-critical);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 19, 0.92);
    backdrop-filter: blur(20px);
    animation: fadeIn 0.35s ease-out;
}

.hh-login-success-content {
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hh-login-heartbeat {
    width: 96px;
    height: 96px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--hh-primary-rgb), 0.12);
    border-radius: 50%;
    border: 1px solid rgba(var(--hh-primary-rgb), 0.25);
}

@keyframes login-heartbeat {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--hh-primary-rgb), 0.4);
    }

    15% {
        transform: scale(1.15);
        box-shadow: 0 0 20px 10px rgba(var(--hh-primary-rgb), 0.2);
    }

    30% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--hh-primary-rgb), 0.1);
    }

    45% {
        transform: scale(1.1);
        box-shadow: 0 0 15px 5px rgba(var(--hh-primary-rgb), 0.15);
    }

    60% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--hh-primary-rgb), 0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Desktop (≥641px) ── */
@media (min-width: 641px) {
    .hh-auth-title {
        font-size: 2.5rem;
    }

    .hh-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hh-auth-card {
        padding: 2.5rem;
    }

    .hh-auth-guidance {
        width: auto;
        justify-content: flex-start;
        border-radius: 999px;
        text-align: left;
    }

    .hh-auth-progress-copy {
        margin: -1.8rem 0 1.6rem;
        font-size: 0.84rem;
    }

    .hh-auth-page .hh-steps {
        transform: none;
        max-width: none;
        overflow-x: visible;
    }
}

/* CompleteProfile */
.hh-complete-profile {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 80vh;
    padding: 1.2rem 0.75rem;
}

.hh-complete-profile-container {
    width: 100%;
    max-width: 720px;
}

.hh-complete-header {
    text-align: center;
    margin-bottom: 2rem;
}

.hh-complete-icon-wrapper {
    display: inline-flex;
    padding: 1rem;
    border-radius: 50%;
    background: rgba(var(--hh-primary-rgb), 0.12);
    margin-bottom: 1rem;
}

.hh-complete-card {
    padding: 1.1rem;
}

.hh-complete-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    color: var(--hh-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hh-complete-progress-meta strong {
    font-size: 0.85rem;
    color: var(--hh-text-primary);
    font-weight: 800;
    letter-spacing: 0.03em;
}

.hh-complete-progress {
    height: 4px;
    background: var(--hh-surface-soft);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.hh-complete-progress-bar {
    height: 100%;
    background: var(--hh-primary);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.hh-complete-actions {
    margin-top: 0.25rem;
    padding: 0.8rem 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--hh-glass-border);
    background: var(--hh-surface-soft);
}

.hh-missing-steps-panel {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem 1.05rem;
    border: 1px solid rgba(var(--hh-primary-rgb), 0.35);
    border-radius: 12px;
    background: var(--hh-surface-soft);
}

.hh-missing-steps-panel h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.hh-missing-step-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.9rem;
}

.hh-missing-step-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--hh-glass-border);
    background: var(--hh-surface-soft);
    color: var(--hh-text-primary);
    font-size: 0.82rem;
    line-height: 1.2;
}

.hh-missing-step-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.hh-complete-sections {
    display: grid;
    gap: 1rem;
}

.hh-complete-section {
    margin: 0;
    padding: 0.9rem 0.85rem 1rem;
}

.hh-complete-section h2 {
    margin: 0 0 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--hh-text-primary);
}

.hh-complete-section p {
    margin: 0 0 0.9rem;
    font-size: 0.92rem;
    color: var(--hh-text-secondary);
}

.hh-complete-section .hh-checkbox-group,
.hh-complete-section .hh-radio-group {
    gap: 0.7rem;
}

.hh-complete-skip {
    text-align: center;
    margin-top: 1rem;
    opacity: 0.6;
}

.hh-complete-success {
    text-align: center;
    padding: 3rem 2rem;
}

@media (min-width: 601px) {
    .hh-complete-profile {
        padding: 2rem 1rem;
    }

    .hh-complete-card {
        padding: 2rem;
    }

    .hh-complete-section {
        padding: 1rem 1rem 1.1rem;
    }

    .hh-complete-actions {
        padding: 0.9rem 1rem 1rem;
    }

    .hh-missing-step-actions {
        flex-direction: row;
    }
}

/* SetupPasskey */
/* Page-specific: passkey icon pulse animation */
.animate-pulse {
    animation: auth-pulse 2s infinite;
}

@keyframes auth-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--hh-primary-rgb), 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(var(--hh-primary-rgb), 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--hh-primary-rgb), 0); }
}
