.nls-form-wrapper {
    max-width: 100%;
    /* Modern adaptable colors */
    --nls-bg: transparent;
    --nls-text: inherit;
    --nls-border: color-mix(in srgb, currentColor 20%, transparent);
    --nls-input-bg: color-mix(in srgb, currentColor 5%, transparent);
    --nls-input-focus: color-mix(in srgb, currentColor 10%, transparent);
    
    /* Button explicitly defined so it doesn't break in some themes */
    --nls-button-bg: #0073aa;
    --nls-button-text: #ffffff;
    --nls-button-hover: #005177;
}

/* Fallbacks for older browsers without color-mix */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .nls-form-wrapper {
        --nls-border: rgba(127, 127, 127, 0.3);
        --nls-input-bg: rgba(127, 127, 127, 0.05);
        --nls-input-focus: rgba(127, 127, 127, 0.1);
    }
}

.nls-form {
    font-family: inherit;
    color: var(--nls-text);
}

.nls-title {
    margin-bottom: 0.5em;
    color: var(--nls-text);
}

.nls-description {
    font-size: 0.9em;
    margin-bottom: 1.2em;
    opacity: 0.8;
}

.nls-field-group {
    margin-bottom: 1em;
}

.nls-label {
    display: block;
    margin-bottom: 0.4em;
    font-weight: 600;
    font-size: 0.95em;
    opacity: 0.9;
}

.nls-input {
    width: 100%;
    padding: 0.75em 1em;
    background-color: var(--nls-input-bg) !important;
    color: var(--nls-text) !important;
    border: 1px solid var(--nls-border) !important;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.nls-input:focus {
    background-color: var(--nls-input-focus) !important;
    border-color: currentColor !important;
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
}

/* Fallback for box-shadow without color-mix */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .nls-input:focus {
        box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.2);
    }
}

.nls-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.nls-consent {
    margin-bottom: 1.2em;
    font-size: 0.85em;
    opacity: 0.8;
}

.nls-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.nls-consent-checkbox {
    margin-top: 3px;
    accent-color: currentColor;
}

.nls-button {
    display: inline-block;
    width: auto;
    padding: 0.7em 2em;
    background-color: var(--nls-button-bg) !important;
    color: var(--nls-button-text) !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    text-align: center;
}

.nls-button:hover {
    background-color: var(--nls-button-hover) !important;
    transform: translateY(-1px);
}

.nls-button:focus {
    outline: 2px solid var(--nls-button-bg);
    outline-offset: 2px;
}

.nls-button:active {
    transform: translateY(0);
}

.nls-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nls-message {
    margin-top: 1em;
    padding: 0.75em 1em;
    border-radius: 6px;
    display: none;
    font-size: 0.9em;
    font-weight: 500;
}

.nls-message--success {
    display: block;
    background: color-mix(in srgb, #10b981 15%, transparent);
    color: #059669;
    border: 1px solid color-mix(in srgb, #10b981 30%, transparent);
}

.nls-message--error {
    display: block;
    background: color-mix(in srgb, #ef4444 15%, transparent);
    color: #dc2626;
    border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
}

.nls-message--info {
    display: block;
    background: color-mix(in srgb, #3b82f6 15%, transparent);
    color: #2563eb;
    border: 1px solid color-mix(in srgb, #3b82f6 30%, transparent);
}

/* Ensure messages look good on dark mode too */
@media (prefers-color-scheme: dark) {
    .nls-message--success { color: #34d399; }
    .nls-message--error { color: #f87171; }
    .nls-message--info { color: #60a5fa; }
}
