/* Scoped Core CSS */
.nl-scope {
    font-family: 'Manrope', sans-serif;
    box-sizing: border-box;
    color: #1e293b;
    width: 100%;
    line-height: 1.5;
}
.nl-scope * { box-sizing: border-box; }

/* Variables */
.nl-scope {
    --nl-primary: #307055;
    --nl-primary-dark: #255742;
    --nl-bg-light: #ffffff;
    --nl-border: #e2e8f0;
    --nl-text-main: #0f172a;
    --nl-text-muted: #64748b;
    --nl-radius: 12px;
    --nl-radius-lg: 16px;
}

/* Utilities */
.nl-hidden { display: none !important; }
.nl-relative { position: relative; }
.nl-block { display: block; }
.nl-flex { display: flex; }
.nl-items-center { align-items: center; }
.nl-justify-between { justify-content: space-between; }
.nl-text-center { text-align: center; }
.nl-mb-2 { margin-bottom: 0.5rem; }
.nl-mb-4 { margin-bottom: 1rem; }
.nl-mb-6 { margin-bottom: 1.5rem; }
.nl-mr-2 { margin-right: 0.5rem; }

/* Typography */
.nl-text-2xl { font-size: 1.5rem; font-weight: 700; color: var(--nl-text-main); margin: 0; }
.nl-text-sm { font-size: 0.875rem; color: var(--nl-text-muted); margin: 0; }
.nl-text-xs { font-size: 0.75rem; }
.nl-font-bold { font-weight: 700; }
.nl-uppercase { text-transform: uppercase; }
.nl-link { color: var(--nl-primary); font-weight: 600; text-decoration: none; cursor: pointer; }
.nl-link:hover { text-decoration: underline; }

/* Login Card */
.nl-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: var(--nl-radius-lg);
    border: 1px solid #ffffff;
    box-shadow: 0 10px 40px -10px rgba(48, 112, 85, 0.1);
}

#sign-in-card input{
    padding-left: 40px !important;
}

/* Inputs */
.nl-input-group { position: relative; }

.nl-input-icon {
    position: absolute;
    left: 12px; /* Fixed position */
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
    pointer-events: none;
    z-index: 10;
}

.nl-input {
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--nl-border) !important;
    font-size: 1rem;
    color: var(--nl-text-main);
    transition: all 0.2s ease;
    font-family: inherit;
    border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
    -moz-border-radius: 5px !important;
    -ms-border-radius: 5px !important;
    -o-border-radius: 5px !important;
}

/* Class for inputs WITHOUT icons */
.nl-input.no-icon { padding: 8px 15px; }

.nl-input:focus {
    outline: none;
    border-color: var(--nl-primary);
    box-shadow: 0 0 0 3px rgba(48, 112, 85, 0.1);
}

/* Buttons */
.nl-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--nl-primary) !important;
    color: #fff;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    font-size: 0.875rem !important;
    transition: background-color 0.2s !important;
}
.nl-btn:hover { background-color: var(--nl-primary-dark); }
.nl-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.nl-checkbox {
    width: 1rem; height: 1rem;
    border-radius: 4px;
    accent-color: var(--nl-primary);
    cursor: pointer;
}

/* Divider */
.nl-divider { position: relative; padding: 1.5rem 0; text-align: center; }
.nl-divider::before {
    content: ""; position: absolute; top: 50%; left: 0; right: 0;
    border-top: 1px solid var(--nl-border); z-index: 0;
}
.nl-divider span {
    position: relative; z-index: 1; background: #fff;
    padding: 0 0.5rem; color: #94a3b8; font-size: 0.75rem;
    font-weight: 600; text-transform: uppercase;
}

/* --- MODAL FIXES --- */
.nl-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.7); /* Darker backdrop */
    backdrop-filter: blur(4px);
    z-index: 99999; /* Max z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.nl-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.nl-modal-content {
    background: #fff;
    width: 100%;
    max-width: 600px;
    height: 75vh; 
    max-height: 800px;
    border-radius: var(--nl-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevents outer scroll */
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nl-modal-overlay.open .nl-modal-content {
    transform: translateY(0);
}

/* Fixed Header */
.nl-modal-header {
    flex-shrink: 0; /* Prevents shrinking */
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    background-color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Scrollable Body */
.nl-modal-body {
    flex-grow: 1; /* Takes remaining space */
    overflow-y: auto; /* Internal scroll only */
    padding: 2rem;
}
/* Body Scrollbar */
.nl-modal-body::-webkit-scrollbar { width: 8px; }
.nl-modal-body::-webkit-scrollbar-track { background: transparent; }
.nl-modal-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; border: 2px solid #fff; }

/* Fixed Footer */
.nl-modal-footer {
    flex-shrink: 0;
    padding: 1.25rem 2rem;
    border-top: 1px solid #f1f5f9;
    background-color: #fff;
}

.nl-close-btn {
    background: transparent!important;
    box-shadow: none!important;
    border: none !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    padding: 0 !important;
    line-height: 0 !important;
}
.nl-close-btn:hover { color: #ef4444; }

/* Form Grid System */
.nl-grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { 
    .nl-grid-2 { 
        grid-template-columns: 1fr 1fr; 
    }
}

@media (max-width: 640px) {
    .nl-card{
        padding: 20px;
    }
    .nl-modal-content{
        height: 70vh;
    }
    .nl-modal-body{
        padding: 20px;
    }
    .nl-modal-header,.nl-modal-footer{
        padding: 15px 20px;
    }
    .nl-input.no-icon{
        padding: 5px 15px !important;
    }
}

.nl-radio-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--nl-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.nl-radio-card:hover { border-color: var(--nl-primary); background-color: rgba(48, 112, 85, 0.05); }

.nl-error-box {
    background-color: #fee2e2; color: #b91c1c;
    padding: 1rem; border-radius: 8px;
    font-size: 0.875rem; font-weight: 700;
    text-align: center; margin-bottom: 1rem;
}

body:has(.nl-scope) div#opl-panel, body:has(.nl-scope) button#wcl-trigger,  body:has(.nl-scope) button#opl-trigger {
    display: none;
}