/* Login Modal Styles - Override base modal styles */
#nrich-lms-login-modal.nrich-lms-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 !important;
}

#nrich-lms-login-modal.nrich-lms-modal[aria-hidden="false"] {
    display: flex !important;
}

/* Blur overlay effect */
#nrich-lms-login-modal .nrich-lms-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    cursor: pointer !important;
    z-index: 0 !important;
}

.nrich-lms-login-modal-content {
    position: relative !important;
    max-width: 1000px !important;
    width: 100% !important;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    background-color: #ffffff !important;
    margin: auto !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
}

.nrich-lms-login-container {
    display: flex;
    min-height: 600px;
    max-height: 90vh;
    width: 100%;
    box-sizing: border-box;
}

/* Left Side: Image */
.nrich-lms-login-image-side {
    flex: 0 0 45%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nrich-lms-login-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.nrich-lms-login-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.nrich-lms-login-image-placeholder svg {
    opacity: 0.3;
}

/* Right Side: Form */
.nrich-lms-login-form-side {
    flex: 1;
    background-color: #ffffff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Welcome Header */
.nrich-lms-welcome-header {
    margin-bottom: 32px;
}

.nrich-lms-welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.nrich-lms-welcome-tagline {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.nrich-lms-otp-info {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.nrich-lms-otp-info strong {
    color: #111827;
    font-weight: 600;
}

/* Login Form */
.nrich-lms-login-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.nrich-lms-login-form .nrich-lms-form-field {
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.nrich-lms-login-form .nrich-lms-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

/* Phone Input Wrapper */
.nrich-lms-phone-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.nrich-lms-phone-input-wrapper input {
    border: none !important;
}

.nrich-lms-phone-input-wrapper:focus-within {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.nrich-lms-dial-code-select {
    flex: 0 0 auto;
    width: 110px;
    max-width: 110px;
    padding: 12px 32px 12px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nrich-lms-phone-number-input {
    flex: 1 1 auto;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 15px;
    color: #111827;
    outline: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.nrich-lms-phone-number-input::placeholder {
    color: #9ca3af;
}

/* OTP Input - Simple Single Field */
.nrich-lms-otp-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: #f9fafb !important;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 8px;
    color: #111827 !important;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    cursor: text;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    caret-color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}

.nrich-lms-otp-input:-webkit-autofill,
.nrich-lms-otp-input:-webkit-autofill:hover,
.nrich-lms-otp-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827 !important;
    -webkit-box-shadow: 0 0 0px 1000px #f9fafb inset !important;
    box-shadow: 0 0 0px 1000px #f9fafb inset !important;
    color: #111827 !important;
}

.nrich-lms-otp-input::-webkit-outer-spin-button,
.nrich-lms-otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nrich-lms-otp-input:focus {
    border-color: #2563eb;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.nrich-lms-otp-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nrich-lms-otp-input::placeholder {
    color: #d1d5db;
    letter-spacing: 8px;
}

.nrich-lms-otp-input::selection {
    background-color: #2563eb;
    color: #ffffff;
}

/* Sign In Button */
.nrich-lms-signin-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.nrich-lms-signin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.nrich-lms-signin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.nrich-lms-signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Message */
.nrich-lms-login-form .nrich-lms-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.nrich-lms-login-form .nrich-lms-form-message.nrich-lms-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.nrich-lms-login-form .nrich-lms-form-message.nrich-lms-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Resend OTP */
.nrich-lms-resend-otp {
    text-align: center;
    margin-top: 24px;
}

.nrich-lms-resend-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.nrich-lms-resend-otp-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.nrich-lms-resend-otp-btn:hover:not(:disabled) {
    opacity: 0.8;
}

.nrich-lms-resend-otp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Close Button */
.nrich-lms-login-modal-content .nrich-lms-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nrich-lms-login-modal-content .nrich-lms-modal-close:hover {
    transform: rotate(90deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    #nrich-lms-login-modal.nrich-lms-modal {
        padding: 10px;
    }

    .nrich-lms-login-container {
        flex-direction: column;
        min-height: auto;
        max-height: 95vh;
    }

    .nrich-lms-login-image-side {
        flex: 0 0 200px;
        min-height: 200px;
    }

    .nrich-lms-login-form-side {
        padding: 32px 24px;
    }

    .nrich-lms-welcome-title {
        font-size: 24px;
    }

    .nrich-lms-welcome-tagline {
        font-size: 14px;
    }

    .nrich-lms-otp-input {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .nrich-lms-otp-input-wrapper {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    #nrich-lms-login-modal.nrich-lms-modal {
        padding: 0;
    }

    .nrich-lms-login-modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0;
    }

    .nrich-lms-login-container {
        height: 100%;
        max-height: 100%;
    }

    .nrich-lms-login-image-side {
        display: none;
    }

    .nrich-lms-login-form-side {
        padding: 24px 20px;
    }

    .nrich-lms-otp-input {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .nrich-lms-otp-input-wrapper {
        gap: 6px;
    }

    .nrich-lms-dial-code-select {
        width: 100px;
        max-width: 100px;
        font-size: 13px;
        padding-right: 28px;
    }
}

/* Login Trigger Button */
.nrich-lms-login-trigger {
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nrich-lms-login-trigger:hover {
    transform: translateY(-2px);
}

/* Logged In Message */
.nrich-lms-logged-in-message {
    padding: 12px 16px;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    font-size: 14px;
}

.nrich-lms-logged-in-message .nrich-lms-logout-link {
    text-decoration: underline;
    margin-left: 8px;
    cursor: pointer;
}

.nrich-lms-logged-in-message .nrich-lms-logout-link:hover {
    opacity: 0.8;
}
