
.sysmodal-overlay[hidden],
.modal-overlay[hidden] {
    display: none !important;
}
.sysmodal-overlay,
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 0, 40, 0.18);
    display: grid;
    place-items: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.sysmodal-overlay {
    z-index: 10001;
}
.modal-overlay {
    z-index: 10000;
}
.sysmodal,
.auth-card {
    max-width: 460px;
    width: calc(100vw - 32px);
    margin: 0 auto;
    padding: 22px 20px 20px;
    border-radius: 20px;
    background: linear-gradient(145deg, #6B34FF, #3B1C91);
    border: 1px solid rgba(255, 255, 255, 0.40);
    box-shadow:
        0 18px 40px rgba(8, 0, 40, 0.70),
        0 0 0 1px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-family: "DM Mono", monospace;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    animation: sysmodal-pop 140ms ease-out;
}
.sysmodal h3,
.auth-card h2 {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    font-family: "Julius Sans One", monospace;
    letter-spacing: 0.12em;
    font-size: 18px;
    text-transform: uppercase;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}
.sysmodal-message {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.90);
    line-height: 1.6;
    word-break: break-word;
    font-size: 15px;
}
.sysmodal-input-wrap {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.sysmodal-input-wrap input:not(.sysmodal-digit),
.auth-card input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 9px 0 7px;
    background: transparent;
    color: #ffffff;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.60);
    border-radius: 0;
    outline: none;
    font-size: 16px;
    font-family: "DM Mono", monospace;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}
.sysmodal-digit {
    width: 2.4ch;
    box-sizing: border-box;
    text-align: center;
    padding: 6px 0;
    background: transparent;
    color: #ffffff;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.60);
    border-radius: 0;
    font-size: 18px;
    font-family: "DM Mono", monospace;
}
.sysmodal-digit:focus {
    outline: none;
    border-bottom-color: #ffffff;
    background-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.sysmodal-input-wrap input::placeholder,
.auth-card input::placeholder {
    color: rgba(255, 255, 255, 0.60);
}
.sysmodal-input-wrap input:focus,
.auth-card input:focus {
    border-bottom-color: #ffffff;
    background-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.sysmodal-actions {
    margin-top: 35px;
    display: flex;
    gap: 10px;
    width: 100%;
}
.sysbtn,
.primary-btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: "DM Mono", monospace;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    text-decoration: none;
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        background 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        opacity 160ms ease;
}
.sysbtn:focus,
.sysbtn:active,
.primary-btn:focus,
.primary-btn:active {
    outline: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}
.sysbtn-primary,
.primary-btn {
    background: linear-gradient(135deg, #6F2DBD, #6F2DBD, #FF4F3C);
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: #ffffff;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.25);
}
@media (hover:hover) and (pointer:fine) {
    .sysbtn-primary:hover,
    .primary-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow:
            0 14px 28px rgba(0, 0, 0, 0.55),
            0 0 0 1px rgba(0, 0, 0, 0.30);
        opacity: 1;
    }
}
.sysbtn-primary:active,
.primary-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.50),
        0 0 0 1px rgba(0, 0, 0, 0.35);
}
.primary-btn:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}
.sysbtn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.90);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: none;
}
@media (hover:hover) and (pointer:fine) {
    .sysbtn-secondary:hover {
        background: rgba(0, 0, 0, 0.14);
        transform: translateY(-1px);
    }
}

.sysbtn-secondary:active {
    transform: translateY(0) scale(0.97);
}
@keyframes sysmodal-pop {
    0% {
        transform: translateY(8px) scale(0.97);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .sysmodal,
    .auth-card {
        width: 92vw;
        max-width: none;
        margin: 0 auto;
        padding: 18px 16px 16px;
        border-radius: 18px;
    }
    .sysmodal h3,
    .auth-card h2 {
        font-size: 22px;
        letter-spacing: 0.10em;
    }
    .sysmodal-message {
        font-size: 16px;
    }
    .sysbtn,
    .primary-btn {
        height: 40px;
        font-size: 16px;
    }
}
