.modal-bg {
    display: none;
    position: fixed;
    z-index: 10001;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: #181828cc;
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}
.modal-bg.active { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 6px 44px #0007;
    min-width: 320px;
    max-width: 96vw;
    padding: 40px 32px 28px 32px;
    position: relative;
    animation: modalIn 0.2s;
}
@keyframes modalIn {
    from {transform: scale(0.97) translateY(32px); opacity: 0;}
    to   {transform: scale(1) translateY(0);      opacity: 1;}
}
.close-btn {
    position: absolute;
    top: 14px; right: 18px;
    background: none;
    border: none;
    font-size: 25px;
    color: #888;
    cursor: pointer;
    transition: color 0.12s;
}
.close-btn:hover { color: #fa9600; }
.modal-box h2 {
    color: #fa9600;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.3em;
    font-weight: bold;
}
.modal-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-box input[type="text"],
.modal-box input[type="password"],
.modal-box input[type="email"] {
    border-radius: 8px;
    border: 1.5px solid #fa960044;
    padding: 12px 13px;
    font-size: 1em;
    background: #f7fafd;
    transition: border 0.13s;
}
.modal-box input:focus { border-color: #fa9600; outline: none; }
.modal-box button[type="submit"] {
    background: linear-gradient(90deg, #fa9600, #ffc65a 70%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 0;
    font-size: 1.07em;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    transition: background 0.17s;
}
.modal-box button[type="submit"]:hover {
    background: linear-gradient(90deg, #ffc65a 30%, #fa9600 90%);
    color: #181818;
}
.switch-link {
    color: #fa9600;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.96em;
    margin: 0 auto;
    margin-top: 9px;
}
@media (max-width: 520px) {
    .modal-box { min-width: 97vw; padding: 24px 8px 14px 8px; }
}