/* Main login container */
.nd-pro-login-container { 
    max-width: 400px; 
    margin: 20px auto; 
    padding: 15px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-family: sans-serif; 
}

/* Form labels */
.nd-pro-label { 
    margin-bottom: 6px; 
    display: block; 
    font-weight: 400; 
    font-size: 14px;
}
.nd-pro-label.required::after {
    content: " *";
    color: red;
}

/* Input fields */
.nd-pro-input { 
    width: 100%; 
    padding: 8px; 
    box-sizing: border-box; 
    margin-bottom: 10px;
    font-size: 14px;
}

/* Input focus states */
input[type="text"]:focus,
input[type="textarea"]:focus,
input[type="url"]:focus,
input[type="password"]:focus, 
input[type="email"]:focus,
input[type="number"]:focus {
    border: 1px solid green;
    outline: none;
}

/* Password toggle wrapper */
.nd-pro-input-wrap {
    position: relative;
    margin-bottom: 10px;
}

/* Password toggle button */
.nd-pro-toggle-pwd {
    position: absolute;
    right: 10px;
    top: 25%;
    bottom: 25%;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Remember me toggle */
.remember-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}
.remember-container label {
    margin-right: 10px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 24px;
}
.switch input { display: none; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #66bb6a;
}
input:checked + .slider:before {
    transform: translateX(36px);
}

/* ON/OFF text */
.slider:after {
    content: 'OFF';
    color: white;
    display: block;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 70%;
    font-size: 10px;
    font-family: Verdana, sans-serif;
    font-weight: bold;
}

input:checked + .slider:after {
    content: 'ON';
    left: 30%;
}

/* Login button container */
.login-button-container {
    margin-top: 10px;
    margin-bottom: 15px;
}

/* Buttons */
.nd-pro-button {
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
}
.nd-pro-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.nd-pro-error-message {
    background: #f8d7da; 
    color: #721c24; 
    padding: 10px; 
    border-radius: 3px; 
    margin-bottom: 10px;
    font-size: 14px;
}
.nd-pro-success-message { 
    background: #d4edda; 
    color: #155724; 
    padding: 10px; 
    margin-bottom: 10px; 
    border-radius: 3px; 
    font-size: 14px;
}
.nd-pro-info-message {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 10px;
    border-radius: 3px;
    margin: 10px 0;
    border: 1px solid #bee5eb;
    font-size: 14px;
}

/* Modal styling - UPDATED FOR MOBILE */
.nd-pro-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    padding: 0 15px;
    box-sizing: border-box;
}
body.nd-pro-modal-open { 
    overflow: hidden; 
}
.nd-pro-modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.nd-pro-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.nd-pro-modal-content p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #555;
    font-size: 14px;
}

/* Code input */
.nd-pro-code-input { 
    text-align: center; 
    letter-spacing: 2px; 
    font-size: 16px;
    padding: 10px;
}

/* Modal buttons container */
.nd-pro-modal-content .nd-pro-button {
    margin-right: 8px;
    margin-bottom: 5px;
}

/* Password Expiry Modal */
.nd-pro-password-expired-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 0 15px;
    box-sizing: border-box;
}
.nd-pro-password-expired-modal .nd-pro-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
}
.nd-pro-password-expired-modal h3 {
    margin-top: 0;
    color: #d9534f;
    font-size: 1.3em;
}
.nd-pro-password-expired-modal #nd-pro-password-change-container {
    margin-top: 20px;
}
.nd-pro-password-expired-modal .nd-pro-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    color: #666;
}
.nd-pro-password-expired-modal .nd-pro-modal-close:hover {
    color: #d9534f;
}
.nd-pro-password-expired-modal .nd-pro-loading {
    text-align: center;
    padding: 20px 0;
}
.nd-pro-password-expired-modal .nd-pro-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: nd-pro-spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}
.nd-pro-password-expired-modal .nd-pro-error-notice {
    color: #d63638;
    padding: 15px;
    background: #f8ebea;
    border-left: 4px solid #d63638;
    margin-bottom: 20px;
    font-size: 14px;
}
.nd-pro-password-expired-modal .nd-pro-expiry-notice {
    background: #f8f9fa;
    border-left: 4px solid #d9534f;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 14px;
}
.nd-pro-password-expired-modal .nd-pro-reset-error {
    margin: -10px 0 15px 0;
    width: calc(100% + 40px);
    margin-left: -20px;
    border-left: none;
    border-top: 3px solid #d63638;
}

/* Input groups */
.nd-pro-input-group {
    margin-bottom: 15px;
}
.nd-pro-input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}
.nd-pro-input-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    font-size: 14px;
}

/* ====================================
   FORCE 2FA MODAL - REFINED STYLING
   ==================================== */
.nd-pro-force-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.nd-pro-force-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: ndProModalSlideIn 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes ndProModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nd-pro-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
}

.nd-pro-modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.nd-pro-close-modal {
    background: none;
    border: none;
    font-size: 26px;
    font-weight: 300;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
    margin-left: 15px;
    flex-shrink: 0;
}

.nd-pro-close-modal:hover {
    background-color: #f8f9fa;
    color: #dc3545;
    transform: scale(1.05);
}

.nd-pro-close-modal:active {
    transform: scale(0.95);
}

.nd-pro-modal-body {
    padding: 20px 25px 25px;
    font-size: 14px;
}

.nd-pro-modal-messages {
    margin-bottom: 15px;
    font-size: 14px;
}

.nd-pro-modal-body h3 {
    margin: 0 0 12px 0;
    font-size: 1.2em;
    color: #2c3e50;
    font-weight: 600;
}

.nd-pro-modal-body p {
    margin: 0 0 15px 0;
    line-height: 1.5;
    color: #5d6d7e;
    font-size: 14px;
}

.nd-pro-modal-body p:last-child {
    margin-bottom: 0;
}

/* Ensure modal backdrop works properly */
.nd-pro-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(155, 89, 182, 0.1) 100%);
    z-index: 9998;
}

/* Smooth transitions for all modal interactions */
.nd-pro-force-modal,
.nd-pro-force-modal-content,
.nd-pro-close-modal {
    transition: all 0.3s ease;
}

/* Animation */
@keyframes nd-pro-spin {
    to { transform: rotate(360deg); }
}

/* ====================================
   RESPONSIVE BREAKPOINTS - MOBILE FIRST
   ==================================== */

/* Small mobile devices (phones, 480px and down) */
@media (max-width: 480px) {
    .nd-pro-modal-content {
        margin: 15% auto;
        padding: 15px;
        border-radius: 6px;
        max-width: 100%;
    }
    
    .nd-pro-modal-content h3 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .nd-pro-modal-content p {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .nd-pro-code-input {
        font-size: 15px;
        padding: 9px;
    }
    
    .nd-pro-button {
        font-size: 13px;
        padding: 7px 14px;
    }
    
    /* Force 2FA Modal adjustments */
    .nd-pro-force-modal-content {
        margin: 8% auto;
        border-radius: 6px;
    }
    
    .nd-pro-modal-header {
        padding: 15px 18px 12px;
        flex-direction: row;
        align-items: center;
    }
    
    .nd-pro-modal-title {
        font-size: 1.1em;
    }
    
    .nd-pro-close-modal {
        font-size: 22px;
        width: 28px;
        height: 28px;
        margin-left: 10px;
    }
    
    .nd-pro-modal-body {
        padding: 15px 18px 18px;
        font-size: 13px;
    }
    
    .nd-pro-modal-body h3 {
        font-size: 1.1em;
    }
    
    .nd-pro-modal-body p {
        font-size: 13px;
    }
    
    .nd-pro-password-expired-modal .nd-pro-modal-content {
        padding: 15px;
    }
    
    .nd-pro-password-expired-modal h3 {
        font-size: 1.2em;
    }
}

/* Medium mobile devices (481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .nd-pro-modal {
        padding: 0 20px;
    }
    
    .nd-pro-modal-content {
        margin: 12% auto;
        padding: 18px;
        max-width: 420px;
    }
    
    .nd-pro-modal-content h3 {
        font-size: 1.25em;
    }
    
    .nd-pro-modal-content p {
        font-size: 13.5px;
    }
    
    .nd-pro-force-modal-content {
        margin: 8% auto;
    }
    
    .nd-pro-modal-header {
        padding: 18px 22px 14px;
    }
    
    .nd-pro-modal-title {
        font-size: 1.15em;
    }
    
    .nd-pro-modal-body {
        padding: 18px 22px 22px;
    }
}

/* Tablets and larger (769px and up) */
@media (min-width: 769px) {
    .nd-pro-modal {
        padding: 0;
    }
    
    .nd-pro-modal-content {
        margin: 10% auto;
    }
    
    .nd-pro-force-modal-content {
        margin: 5% auto;
    }
}

/* Extra small devices (very small phones, 360px and down) */
@media (max-width: 360px) {
    .nd-pro-modal-content {
        margin: 10% auto;
        padding: 12px;
    }
    
    .nd-pro-modal-content h3 {
        font-size: 1.1em;
    }
    
    .nd-pro-modal-content p {
        font-size: 12px;
    }
    
    .nd-pro-code-input {
        font-size: 14px;
        padding: 8px;
    }
    
    .nd-pro-button {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .nd-pro-force-modal-content {
        margin: 5% auto;
    }
    
    .nd-pro-modal-header {
        padding: 12px 15px 10px;
    }
    
    .nd-pro-modal-title {
        font-size: 1em;
    }
    
    .nd-pro-close-modal {
        font-size: 20px;
        width: 26px;
        height: 26px;
    }
    
    .nd-pro-modal-body {
        padding: 12px 15px 15px;
        font-size: 12px;
    }
    
    .nd-pro-modal-body h3 {
        font-size: 1em;
    }
    
    .nd-pro-modal-body p {
        font-size: 12px;
    }
}

/* Ensure form elements don't overflow on small screens */
.nd-pro-input,
.nd-pro-code-input,
.nd-pro-button {
    max-width: 100%;
}

/* Prevent horizontal scrolling on modals */
.nd-pro-modal-content,
.nd-pro-force-modal-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
}