html.auth-modal-open,
body.auth-modal-open {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.4);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    z-index: 10000;
    overflow-y: auto;
    backdrop-filter: blur(8px);
}

.auth-modal-container {
    background: linear-gradient(180deg, #ffffff 0%, #f8f6fc 100%);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 28px 25px;
    position: relative;
    box-shadow: 0 25px 80px rgba(79, 0, 140, 0.35), 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 40px;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
}

.auth-modal-close:hover {
    background: #7c14c2;
    color: white;
    transform: rotate(90deg);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7c14c2 0%, #4f008c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    box-shadow: 0 8px 20px rgba(124, 20, 194, 0.4);
}

.auth-modal-icon svg {
    width: 32px;
    height: 32px;
}

.auth-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.auth-message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.auth-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #28a745;
}

.auth-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #dc3545;
}

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

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    text-align: right;
}

.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #7c14c2;
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 20, 194, 0.1);
}

.auth-input::placeholder {
    color: #aaa;
}

.auth-forgot-link {
    text-align: left;
    margin-bottom: 12px;
}

.auth-forgot-link a {
    color: #7c14c2;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-forgot-link a:hover {
    color: #4f008c;
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #7c14c2 0%, #5a0f8f 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(124, 20, 194, 0.35);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #5a0f8f 0%, #3d0a66 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(124, 20, 194, 0.45);
}

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

.auth-switch-link {
    text-align: center;
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

.auth-switch-link a {
    color: #7c14c2;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-switch-link a:hover {
    color: #4f008c;
    text-decoration: underline;
}

.auth-otp-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-otp-icon {
    margin-bottom: 10px;
}

.auth-otp-icon svg {
    margin: 0 auto 12px;
    width: 48px;
    height: 48px;
}

.auth-otp-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.auth-otp-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.auth-otp-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.auth-otp-box {
    width: 42px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.3s ease;
    color: #1a1a2e;
}

.auth-otp-box:focus {
    border-color: #7c14c2;
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 20, 194, 0.15);
    transform: scale(1.05);
}

.auth-otp-box.filled {
    border-color: #7c14c2;
    background: #f8f0ff;
}

.auth-reset-box {
    width: 42px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.3s ease;
    color: #1a1a2e;
}

.auth-reset-box:focus {
    border-color: #7c14c2;
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 20, 194, 0.15);
    transform: scale(1.05);
}

.auth-reset-box.filled {
    border-color: #7c14c2;
    background: #f8f0ff;
}

.auth-resend-link {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #888;
}

.auth-resend-link a {
    color: #7c14c2;
    font-weight: 600;
    text-decoration: none;
    margin-right: 5px;
}

.auth-resend-link a:hover {
    text-decoration: underline;
}

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

.auth-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-back-link a:hover {
    color: #7c14c2;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-modal-header.hidden {
    display: none;
}

@media (max-width: 520px) {
    .auth-modal-container {
        width: 95%;
        padding: 22px 16px;
        border-radius: 16px;
    }
    .auth-otp-box {
        width: 38px;
        height: 46px;
        font-size: 18px;
    }
    .auth-otp-inputs {
        gap: 6px;
    }
    .auth-reset-box {
        width: 38px;
        height: 46px;
        font-size: 18px;
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.s-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: modalFadeIn 0.15s ease-out;
    backdrop-filter: blur(3px);
}
.s-modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    width: 88%;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.2s ease-out;
}
.s-modal-body {
    padding: 18px;
}
.s-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(79, 0, 140, 0.1);
}
.s-modal-close {
    background: rgba(79, 0, 140, 0.08);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.s-modal-close:hover {
    background: rgba(79, 0, 140, 0.15);
    transform: rotate(90deg);
}
.s-modal-close:active {
    transform: rotate(90deg) scale(0.9);
}
.s-modal-close svg {
    fill: #4f008c;
    width: 18px;
    height: 18px;
}
.s-modal-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.s-login-modal-header-icon {
    background: linear-gradient(135deg, #4f008c 0%, #7c14c2 100%);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(79, 0, 140, 0.25);
}
.s-login-modal-header-icon svg {
    fill: white;
    width: 24px;
    height: 24px;
}
.s-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}
.s-login-modal-label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
}
.s-modal-wrapper .form-group {
    margin-bottom: 14px;
}
.s-modal-wrapper .form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fafafa;
}
.s-modal-wrapper .form-control:focus {
    border-color: #4f008c;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 0, 140, 0.1);
    outline: none;
}
.s-modal-wrapper .form-control::placeholder {
    color: #aaa;
}
.s-modal-wrapper .button {
    background: linear-gradient(135deg, #4f008c 0%, #6a0dad 100%);
    color: white;
    border: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(79, 0, 140, 0.25);
}
.s-modal-wrapper .button:hover {
    background: linear-gradient(135deg, #5c00a3 0%, #7c14c2 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 0, 140, 0.35);
}
.s-modal-wrapper .button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 0, 140, 0.25);
}
.s-modal-wrapper .link {
    font-size: 14px;
}
.s-modal-wrapper .link a {
    color: #4f008c;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}
.s-modal-wrapper .link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4f008c;
    transition: width 0.3s ease;
}
.s-modal-wrapper .link a:hover::after {
    width: 100%;
}
.s-modal-wrapper .link a:hover {
    color: #6a0dad;
}
.s-modal-wrapper .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #b1dfbb;
    font-size: 13px;
    animation: successPop 0.25s ease-out;
}
.s-modal-wrapper .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #f5c6cb;
    font-size: 13px;
    animation: shake 0.25s ease-out;
}
.mobile-otp-box, .mobile-reset-box {
    width: 40px !important;
    height: 48px !important;
    text-align: center;
    font-size: 18px !important;
    font-weight: 700;
    border: 2px solid #e0e0e0 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    background: #fafafa;
    color: #1a1a2e !important;
}
.mobile-otp-box:focus, .mobile-reset-box:focus {
    border-color: #4f008c !important;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 0, 140, 0.12);
    outline: none;
    transform: scale(1.03);
}
.mobile-otp-box.filled, .mobile-reset-box.filled {
    border-color: #4f008c !important;
    background: rgba(79, 0, 140, 0.05);
}
.s-login-modal-wrapper p {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
}
