/* 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-has-login-image .nrich-lms-login-image-side {
    background: none !important;
}

.nrich-has-login-image .nrich-lms-login-image-placeholder {
    background: transparent !important;
}

.nrich-has-login-image .nrich-lms-login-image-placeholder svg {
    display: none !important;
}

.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-auth-method {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.nrich-lms-auth-option {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.nrich-lms-auth-option input[type="radio"] {
    margin: 0;
}

.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;
    appearance: none;
    -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;
}

.nrich-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 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;
    background: transparent !important;
    box-shadow: none !important;
}

.nrich-lms-login-modal-content .nrich-lms-modal-close:hover {
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.nrich-lms-login-modal-content .nrich-lms-modal-close:active,
.nrich-lms-login-modal-content .nrich-lms-modal-close:focus,
.nrich-lms-login-modal-content .nrich-lms-modal-close:focus-visible {
    background: transparent !important;
    box-shadow: none !important;
}

/* 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;
}

/* ===== Updated Login UI (login/login.html + login/login.css) ===== */
#nrich-lms-login-modal .nrich-lms-login-modal-content {
    overflow: auto !important;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content {
    --bg: #f6f8ff;
    --text-primary: #0c1421;
    --text-muted: #313957;
    --text-light: #64748b;
    --brand: #008ce4;
    --field-bg: #f7fbff;
    --field-border: #a5a5a5;
    --white: #ffffff;

    font-family: "Inter", sans-serif;
    background: var(--bg) !important;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .page {
    min-height: auto;
    display: grid;
    place-items: center;
    /* padding: 24px; */
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .card {
    /* width: min(900px, 100%); */
    width: 100% !important;
    min-height: 563px;
    display: grid;
    grid-template-columns: 317px 1fr;
    background: var(--bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(12, 20, 33, 0.08);
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .card__content {
    padding: 56px 56px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .content-header h1 {
    color: var(--text-primary);
    font-family: "Poppins", sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 14px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .content-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .signin-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .switch-group {
    display: flex;
    align-items: center;
    gap: 18px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .switch-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1e1e1e;
    cursor: pointer;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .switch-group input[type="radio"] {
    accent-color: var(--brand);
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .switch-option--active {
    color: var(--brand) !important;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .field > span {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-primary);
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .field__input-wrap {
    background: var(--field-bg);
    border: 1px solid #d4d7e3;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .country-code {
    color: #12110d;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    padding-right: 10px;
    border-right: 1px solid #d4d7e3;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .field input {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .field input::placeholder {
    color: #8897ad;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .field-error {
    color: #d92d20;
    font-size: 12px;
    font-weight: 500;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .is-hidden {
    display: none;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .btn {
    border: none;
    border-radius: 9px;
    font-size: 14px;
    cursor: pointer;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .btn--primary {
    background: var(--brand);
    color: var(--white);
    padding: 14px;
    font-weight: 500;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-section.is-hidden {
    display: none;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-inputs {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-digit {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    border: 1px solid rgba(107, 114, 128, 0.6);
    background: #fff;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-digit:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(0, 140, 228, 0.14);
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-edit {
    border: none;
    background: transparent;
    color: #202226;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .otp-resend {
    color: #a2a5b1;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .divider {
    display: flex;
    align-items: center;
    gap: 12px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .divider span {
    flex: 1;
    height: 1px;
    background: #cfdfe2;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .divider p {
    color: var(--text-light);
    font-size: 13px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#nrich-lms-login-modal .nrich-lms-login-modal-content .btn--social {
    width: 100%;
    background: var(--white);
    color: var(--text-muted);
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
}

@media (max-width: 800px) {
    #nrich-lms-login-modal .nrich-lms-login-modal-content .card {
        grid-template-columns: 1fr;
    }

    #nrich-lms-login-modal .nrich-lms-login-modal-content .card__image {
        max-height: 220px;
    }

    #nrich-lms-login-modal .nrich-lms-login-modal-content .card__content {
        padding: 28px 20px;
    }
}
