body:has(.auth-modal-overlay.active) {
    overflow: hidden;
    height: 100vh;
    touch-action: none;
}

.auth-modal-overlay {
    height: 100dvh;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s, background 0.3s ease, backdrop-filter 0.3s ease;

    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.auth-modal-overlay.active {
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    background: rgba(5, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    transition: opacity 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

.auth-modal-overlay.closing {
    opacity: 0;
    background: rgba(5, 10, 15, 0);
    backdrop-filter: blur(0px);
    transition: all 0.25s ease;
}

.auth-container {
    width: 100%;
    max-width: 100%;
    perspective: 1000px;
    transform-style: preserve-3d;
    position: relative;
    max-height: none;
    display: flex;
    flex-direction: column;
    margin: auto;
    padding: 20px 0;
}

.auth-card-wrapper {
    position: relative;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(45, 212, 191, 0.2) 50%, rgba(74, 222, 128, 0.2) 100%);
    padding: 2px;
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(74, 222, 128, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: auth-border-glow 4s ease infinite;
    transform-style: preserve-3d;
    max-height: none;
    display: flex;
    flex-direction: column;
}

@keyframes auth-border-glow {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(74, 222, 128, 0.1),
            0 20px 60px rgba(0, 0, 0, 0.6),
            0 0 40px rgba(74, 222, 128, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(74, 222, 128, 0.2),
            0 20px 60px rgba(0, 0, 0, 0.6),
            0 0 60px rgba(74, 222, 128, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

.auth-card {
    background: linear-gradient(180deg, rgba(15, 35, 25, 0.95) 0%, rgba(10, 25, 18, 0.98) 100%);
    border-radius: 14px;
    width: 100%;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    max-height: none;
    display: flex;
    flex-direction: column;
}

.auth-modal-overlay.active .auth-card {
    animation: auth-telegram-spring 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.auth-modal-overlay.closing .auth-card {
    animation: auth-telegram-out 0.3s cubic-bezier(0.32, 0, 0.67, 0) forwards;
}

@keyframes auth-telegram-spring {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes auth-telegram-out {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
}

.auth-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.auth-face.front {
    position: relative;
}

.auth-face.back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(180deg);
}

.auth-container.flip .auth-face.front {
    transform: rotateY(180deg);
}

.auth-container.flip .auth-face.back {
    transform: rotateY(360deg);
}

.auth-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-green);
    opacity: 0.6;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.auth-corner-tl { top: 12px; left: 12px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.auth-corner-tr { top: 12px; right: 12px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.auth-corner-bl { bottom: 12px; left: 12px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.auth-corner-br { bottom: 12px; right: 12px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }


.auth-modal-header {
    padding: 20px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-pixel-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-green);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    animation: auth-pulse-glow 3s infinite;
    flex-shrink: 0;
}

@keyframes auth-pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(74, 222, 128, 0.6); }
    50% { box-shadow: 0 0 25px rgba(74, 222, 128, 0.9); }
}

.auth-title-group h2 {
    font-family: 'VT323', monospace;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    color: var(--accent-green);
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
    letter-spacing: 2px;
    line-height: 1.2;
}

.auth-title-group p {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.auth-close {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.05);
    color: #fca5a5;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.auth-close:hover, .auth-close:active {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.6);
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.3);
}

.auth-terminal {
    margin: 0 16px 16px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: var(--text-secondary);
    font-family: 'VT323', monospace;
    background: rgba(74, 222, 128, 0.05);
    border: 1px solid rgba(74, 222, 128, 0.1);
    border-radius: 8px;
    position: relative;
    z-index: 5;
    opacity: 0;
    transform: translateX(-10px);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.auth-modal-overlay.active .auth-terminal {
    animation: auth-slide-in 0.4s ease 0.2s forwards;
}

@keyframes auth-slide-in {
    to { opacity: 1; transform: translateX(0); }
}

.auth-prompt {
    color: var(--accent-teal);
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
    white-space: nowrap;
}

.auth-cursor {
    display: inline-block;
    width: 6px;
    height: 14px;
    background: var(--accent-green);
    animation: auth-blink 1.2s infinite;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    flex-shrink: 0;
}

@keyframes auth-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.auth-body {
    padding: 0 16px 16px;
    position: relative;
    z-index: 5;
    overflow-y: visible;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-green) transparent;
}

.auth-body::-webkit-scrollbar {
    width: 4px;
}

.auth-body::-webkit-scrollbar-thumb {
    background: var(--border-green);
    border-radius: 2px;
}

.auth-form-group {
    margin-bottom: 14px;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
}

.auth-modal-overlay.active .auth-form-group {
    animation: auth-fade-up 0.4s ease forwards;
}

.auth-modal-overlay.active .auth-form-group:nth-child(1) { animation-delay: 0.25s; }
.auth-modal-overlay.active .auth-form-group:nth-child(2) { animation-delay: 0.3s; }
.auth-modal-overlay.active .auth-form-group:nth-child(3) { animation-delay: 0.35s; }
.auth-modal-overlay.active .auth-form-group:nth-child(4) { animation-delay: 0.4s; }

@keyframes auth-fade-up {
    to { opacity: 1; transform: translateY(0); }
}

.auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.auth-input {
    width: 100%;
    background: rgba(5, 15, 10, 0.6);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 12px 12px 40px;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-height: 48px;
}

.auth-input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1), 0 0 20px rgba(74, 222, 128, 0.15);
    background: rgba(5, 15, 10, 0.8);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-pass-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-pass-toggle:hover, .auth-pass-toggle:active {
    color: var(--accent-green);
}

.auth-pass-strength {
    height: 3px;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.auth-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.4s ease;
    border-radius: 2px;
}

.auth-strength-text {
    font-size: clamp(0.7rem, 1.5vw, 0.75rem);
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'VT323', monospace;
}

.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px;
    background: rgba(74, 222, 128, 0.03);
    border: 1px solid rgba(74, 222, 128, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-height: 44px;
}

.auth-checkbox-group:hover, .auth-checkbox-group:active {
    background: rgba(74, 222, 128, 0.06);
    border-color: rgba(74, 222, 128, 0.2);
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-green);
    border-radius: 5px;
    background: rgba(5, 15, 10, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.auth-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
}

.auth-checkbox::after {
    content: '✓';
    color: var(--bg-dark);
    font-size: 0.75rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.auth-checkbox.checked::after {
    opacity: 1;
    transform: scale(1);
}

.auth-checkbox-label {
    font-size: clamp(0.8rem, 1.8vw, 0.85rem);
    color: var(--text-secondary);
    line-height: 1.4;
    user-select: none;
}

.auth-checkbox-label a {
    color: var(--accent-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.auth-checkbox-label a:hover {
    border-bottom-color: var(--accent-green);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.auth-forgot {
    text-align: center;
    margin-top: 14px;
}

.auth-forgot a {
    color: var(--accent-teal);
    font-size: clamp(0.8rem, 1.8vw, 0.85rem);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
    padding: 8px;
    display: inline-block;
}

.auth-forgot a:hover {
    border-bottom-color: var(--accent-teal);
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.auth-footer {
    padding: 16px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    background: linear-gradient(to top, rgba(15, 35, 25, 0.95), transparent);
}

.auth-btn {
    width: 100%;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    color: var(--accent-green);
    padding: 14px 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    min-height: 48px;
    touch-action: manipulation;
}

.auth-modal-overlay.active .auth-btn {
    animation: auth-fade-up 0.4s ease forwards;
}

.auth-modal-overlay.active .auth-btn:nth-of-type(1) { animation-delay: 0.45s; }
.auth-modal-overlay.active .auth-btn:nth-of-type(2) { animation-delay: 0.5s; }

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before, .auth-btn:active::before {
    left: 100%;
}

.auth-btn:hover, .auth-btn:active {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 222, 128, 0.2);
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-teal) 100%);
    color: var(--bg-dark);
    border: none;
    font-weight: 600;
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    letter-spacing: 0.5px;
}

.auth-btn.primary:hover, .auth-btn.primary:active {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #5ee6d3 100%);
    box-shadow: 0 8px 30px rgba(74, 222, 128, 0.4);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: clamp(0.75rem, 1.5vw, 0.8rem);
    margin: 4px 0;
    opacity: 0;
}

.auth-modal-overlay.active .auth-divider {
    animation: auth-fade-in 0.3s ease 0.48s forwards;
}

@keyframes auth-fade-in {
    to { opacity: 1; }
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-green), transparent);
}

.auth-switch {
    text-align: center;
    color: var(--text-muted);
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    padding-top: 8px;
    opacity: 0;
}

.auth-modal-overlay.active .auth-switch {
    animation: auth-fade-in 0.3s ease 0.52s forwards;
}

.auth-switch button {
    background: none;
    border: none;
    color: var(--accent-green);
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    padding: 4px;
    touch-action: manipulation;
}

.auth-switch button:hover {
    border-bottom-color: var(--accent-green);
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.auth-btn.loading {
    position: relative;
    color: transparent !important;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--bg-dark);
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-form-group.error .auth-input {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.auth-form-group.error .auth-input-icon {
    color: var(--error-red);
}

.auth-error-msg {
    color: var(--error-red);
    font-size: clamp(0.75rem, 1.5vw, 0.8rem);
    margin-top: 6px;
    font-family: 'VT323', monospace;
    display: none;
}

.auth-form-group.error .auth-error-msg {
    display: block;
    animation: auth-shake 0.5s ease;
}

@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.auth-matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.03;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
}

.auth-flip-hint {
    display: none;
}

@media (max-width: 576px) {
    .auth-modal-overlay {
        padding: 12px;
        align-items: flex-start;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }

    .auth-container {
        padding: 16px 0 32px;
        margin: auto;
    }

    .auth-card-wrapper {
        border-radius: 14px;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-modal-header {
        padding: 16px 16px 12px;
    }

    .auth-terminal {
        margin: 0 12px 12px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .auth-body {
        padding: 0 12px 12px;
    }

    .auth-footer {
        padding: 12px 12px 20px;
    }

    .auth-brand {
        gap: 10px;
    }

    .auth-pixel-icon {
        width: 28px;
        height: 28px;
    }

    .auth-title-group h2 {
        font-size: 1.3rem;
    }

    .auth-input {
        padding: 10px 10px 10px 36px;
        min-height: 44px;
    }

    .auth-btn {
        padding: 12px 16px;
        min-height: 44px;
    }

    .auth-form-group {
        margin-bottom: 12px;
    }

    .auth-checkbox-group {
        margin-top: 10px;
        padding: 8px;
        min-height: 40px;
    }

    .auth-close {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .auth-modal-overlay {
        padding: 24px;
        align-items: flex-start;
        padding-bottom: max(32px, env(safe-area-inset-bottom));
    }

    .auth-container {
        max-width: 520px;
        padding: 20px 0 40px;
        margin: auto;
    }

    .auth-card-wrapper {
        border-radius: 20px;
    }

    .auth-card {
        border-radius: 18px;
    }

    .auth-modal-header {
        padding: 24px 24px 20px;
    }

    .auth-terminal {
        margin: 0 24px 20px;
        padding: 12px 16px;
    }

    .auth-body {
        padding: 0 24px 20px;
    }

    .auth-footer {
        padding: 16px 24px 28px;
    }

    .auth-brand {
        gap: 14px;
    }

    .auth-pixel-icon {
        width: 36px;
        height: 36px;
    }

    .auth-input {
        padding: 14px 14px 14px 44px;
    }

    .auth-btn {
        padding: 16px 24px;
    }

    .auth-corner {
        width: 28px;
        height: 28px;
    }
}

@media (min-width: 769px) {
    .auth-modal-overlay {
        padding: 40px;
        align-items: center;
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }

    .auth-container {
        max-width: 480px;
        padding: 0;
        margin: 0;
    }

    .auth-card-wrapper {
        border-radius: 22px;
    }

    .auth-card {
        border-radius: 20px;
        max-height: calc(100dvh - 80px);
    }

    .auth-modal-header {
        padding: 28px 28px 20px;
    }

    .auth-terminal {
        margin: 0 28px 20px;
        padding: 12px 16px;
    }

    .auth-body {
        padding: 0 28px 20px;
        overflow-y: auto;
    }

    .auth-footer {
        padding: 16px 28px 28px;
    }

    .auth-close:hover {
        transform: rotate(90deg) scale(1.1);
    }

    .auth-btn:hover {
        transform: translateY(-3px);
    }

    .auth-card:hover .auth-corner {
        opacity: 1;
        box-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
    }

    .auth-corner {
        width: 30px;
        height: 30px;
    }

    .auth-corner-tl { top: 15px; left: 15px; border-radius: 8px 0 0 0; }
    .auth-corner-tr { top: 15px; right: 15px; border-radius: 0 8px 0 0; }
    .auth-corner-bl { bottom: 15px; left: 15px; border-radius: 0 0 0 8px; }
    .auth-corner-br { bottom: 15px; right: 15px; border-radius: 0 0 8px 0; }
}

@media (min-width: 1200px) {
    .auth-container {
        max-width: 520px;
    }

    .auth-modal-overlay {
        padding: 60px;
    }

    .auth-flip-hint {
        display: block;
        position: absolute;
        top: 50%;
        right: -50px;
        transform: translateY(-50%);
        color: var(--accent-green);
        font-size: 1.2rem;
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
        font-family: 'VT323', monospace;
        text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
        animation: auth-pulse-hint 2s infinite;
    }

    @keyframes auth-pulse-hint {
        0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(1); }
        50% { opacity: 0.6; transform: translateY(-50%) scale(1.1); }
    }

    .auth-container:hover .auth-flip-hint {
        right: -40px;
        opacity: 0.5;
    }

    .auth-container.flip .auth-flip-hint {
        right: auto;
        left: -50px;
    }

    .auth-container.flip:hover .auth-flip-hint {
        left: -40px;
    }
}

@media (max-height: 700px) and (min-width: 577px) {
    .auth-modal-overlay {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
        overflow-y: auto;
    }

    .auth-container {
        margin: auto;
        padding: 20px 0;
    }

    .auth-card {
        max-height: none;
    }
}

@media (max-height: 600px) and (max-width: 576px) {
    .auth-modal-overlay {
        align-items: flex-start;
        padding: 8px;
        padding-bottom: 32px;
        overflow-y: auto;
    }

    .auth-container {
        padding: 12px 0 24px;
    }

    .auth-card {
        max-height: none;
    }

    .auth-modal-header {
        padding: 14px 14px 10px;
    }

    .auth-terminal {
        margin: 0 14px 10px;
        padding: 6px 10px;
    }

    .auth-body {
        padding: 0 14px 10px;
    }

    .auth-footer {
        padding: 10px 14px 16px;
    }

    .auth-form-group {
        margin-bottom: 8px;
    }

    .auth-form-group label {
        margin-bottom: 4px;
        font-size: 0.65rem;
    }

    .auth-input {
        padding: 8px 8px 8px 34px;
        min-height: 40px;
    }

    .auth-checkbox-group {
        margin-top: 8px;
        padding: 6px;
        min-height: 36px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .auth-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .auth-btn:active {
        transform: scale(0.98);
        background: rgba(74, 222, 128, 0.2);
    }

    .auth-close:hover {
        transform: none;
    }

    .auth-close:active {
        transform: rotate(90deg);
    }

    .auth-input {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-modal-overlay.active .auth-card,
    .auth-modal-overlay.active .auth-terminal,
    .auth-modal-overlay.active .auth-form-group,
    .auth-modal-overlay.active .auth-btn,
    .auth-modal-overlay.active .auth-divider,
    .auth-modal-overlay.active .auth-switch,
    .auth-face,
    .auth-cursor,
    .auth-border-glow,
    .auth-pulse-glow,
    .auth-pulse-hint {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }

    .auth-container.flip .auth-face.front {
        transform: rotateY(180deg);
    }

    .auth-container.flip .auth-face.back {
        transform: rotateY(360deg);
    }
}

@supports (padding: max(0px)) {
    .auth-modal-overlay {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}