/* =============================================
   Roamer Newsletter & CRM — Subscribe Forms
   ============================================= */

:root {
    --rnc-primary: #6366f1;
    --rnc-primary-light: #818cf8;
    --rnc-primary-glow: rgba(99, 102, 241, 0.3);
    --rnc-bg-dark: #0f0f23;
    --rnc-bg-card: #1a1a2e;
    --rnc-bg-input: #12122a;
    --rnc-text: #e2e8f0;
    --rnc-text-muted: #94a3b8;
    --rnc-border: rgba(99, 102, 241, 0.2);
    --rnc-success: #22c55e;
    --rnc-radius: 12px;
}

/* === Popup Overlay === */
.rnc-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.rnc-popup-overlay.rnc-show {
    display: flex;
    opacity: 1;
}

.rnc-popup-box {
    background: var(--rnc-bg-card);
    border: 1px solid var(--rnc-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--rnc-primary-glow);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.rnc-popup-overlay.rnc-show .rnc-popup-box {
    transform: translateY(0) scale(1);
}

.rnc-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--rnc-text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rnc-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* === Inline Form (Post Footer CTA) === */
.rnc-inline-form {
    background: linear-gradient(135deg, var(--rnc-bg-card) 0%, #16162e 100%);
    border: 1px solid var(--rnc-border);
    border-radius: var(--rnc-radius);
    padding: 32px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.rnc-inline-form::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--rnc-primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

/* === Common Form Styles === */
.rnc-form-title {
    color: #a5b4fc;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    position: relative;
}

.rnc-form-desc {
    color: var(--rnc-text-muted);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.6;
}

.rnc-form-group {
    margin-bottom: 16px;
}

.rnc-form-row {
    display: flex;
    gap: 12px;
}

.rnc-form-row .rnc-form-group {
    flex: 1;
}

.rnc-form-label {
    display: block;
    color: var(--rnc-text-muted);
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
}

.rnc-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--rnc-bg-input);
    border: 1px solid var(--rnc-border);
    border-radius: 8px;
    color: var(--rnc-text);
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.rnc-input:focus {
    border-color: var(--rnc-primary);
    box-shadow: 0 0 0 3px var(--rnc-primary-glow);
}

.rnc-input::placeholder {
    color: #475569;
}

/* Interest tags checkboxes */
.rnc-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.rnc-interest-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--rnc-bg-input);
    border: 1px solid var(--rnc-border);
    border-radius: 20px;
    color: var(--rnc-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.rnc-interest-tag:hover {
    border-color: var(--rnc-primary-light);
    color: var(--rnc-text);
}

.rnc-interest-tag input[type="checkbox"] {
    display: none;
}

.rnc-interest-tag.rnc-checked {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--rnc-primary);
    color: var(--rnc-primary-light);
}

/* Submit button */
.rnc-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--rnc-primary), var(--rnc-primary-light));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.rnc-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--rnc-primary-glow);
}

.rnc-submit:active {
    transform: translateY(0);
}

.rnc-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rnc-submit .rnc-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rnc-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.rnc-submit.rnc-loading .rnc-spinner {
    display: inline-block;
}

@keyframes rnc-spin {
    to { transform: rotate(360deg); }
}

/* Success / Error messages */
.rnc-msg {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    display: none;
}

.rnc-msg-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
    display: block;
}

.rnc-msg-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    display: block;
}

/* GDPR checkbox */
.rnc-gdpr {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--rnc-text-muted);
    line-height: 1.5;
}

.rnc-gdpr input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--rnc-primary);
}

/* Toast notification */
.rnc-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.rnc-toast-show {
    transform: translateX(0);
}

.rnc-toast-confirmed {
    background: linear-gradient(135deg, #065f46, #064e3b);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.rnc-toast-unsubscribed {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.rnc-toast-error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .rnc-popup-box {
        padding: 28px 20px;
    }
    .rnc-form-row {
        flex-direction: column;
        gap: 0;
    }
    .rnc-inline-form {
        padding: 24px 16px;
    }
}
