/* ============================================
   Developer Newsletter PDF - Frontend Styles
   ============================================ */

/* ---- Variables ---- */
.dnp-newsletter-form {
    --dnp-accent: #fb8124;
    --dnp-accent-hover: color-mix(in srgb, var(--dnp-accent) 85%, #000);
    --dnp-text: #333333;
    --dnp-text-light: #666666;
    --dnp-bg: #ffffff;
    --dnp-border: #e0e0e0;
    --dnp-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
}

.dnp-newsletter-form *,
.dnp-newsletter-form *::before,
.dnp-newsletter-form *::after {
    box-sizing: border-box;
}

/* =============================================
   MODAL / POPUP OVERLAY
   ============================================= */
.dnp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: dnp-overlayIn 0.25s ease;
}

@keyframes dnp-overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Prevent body scroll when modal open */
body.dnp-modal-open {
    overflow: hidden;
}

/* ---- Modal Container ---- */
.dnp-modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    animation: dnp-modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dnp-modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---- Close Button ---- */
.dnp-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f1;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.dnp-modal-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* ---- Modal Body ---- */
.dnp-modal-body {
    padding: 0;
}

/* Popup form styles inside modal */
.dnp-style-popup .dnp-form-inner {
    padding: 36px 32px 28px;
    text-align: center;
}

/* =============================================
   INLINE FORM (non-popup)
   ============================================= */
.dnp-inline {
    max-width: 520px;
    margin: 0 auto;
}

.dnp-inline .dnp-form-inner {
    background: var(--dnp-bg);
    border-radius: var(--dnp-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 32px;
    border: 1px solid var(--dnp-border);
    text-align: center;
}

/* =============================================
   SHARED FORM STYLES (popup + inline)
   ============================================= */

/* ---- Typography ---- */
.dnp-form-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dnp-text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.dnp-form-subtitle {
    font-size: 15px;
    color: var(--dnp-text-light);
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ---- Fields ---- */
.dnp-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dnp-field {
    width: 100%;
}

.dnp-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--dnp-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--dnp-text);
    background: var(--dnp-bg);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.dnp-input::placeholder {
    color: #aaa;
}

.dnp-input:focus {
    border-color: var(--dnp-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dnp-accent) 15%, transparent);
}

.dnp-input.dnp-input-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}

/* ---- Button ---- */
.dnp-submit-btn {
    width: 100%;
    padding: 14px 28px;
    background: var(--dnp-accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

.dnp-submit-btn:hover {
    background: var(--dnp-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--dnp-accent) 35%, transparent);
}

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

.dnp-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dnp-btn-loading svg {
    display: block;
}

/* ---- Messages ---- */
.dnp-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    animation: dnp-fadeIn 0.3s ease;
}

.dnp-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dnp-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---- Privacy ---- */
.dnp-privacy {
    margin: 16px 0 0;
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* ---- Admin Notice ---- */
.dnp-admin-notice {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

.dnp-admin-notice a {
    color: #856404;
    font-weight: 600;
}

.dnp-admin-notice code {
    background: rgba(0,0,0,0.08);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ---- Animations ---- */
@keyframes dnp-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 480px) {
    .dnp-modal-container {
        max-width: 100%;
        border-radius: 12px;
    }

    .dnp-style-popup .dnp-form-inner {
        padding: 28px 20px 24px;
    }

    .dnp-form-title {
        font-size: 19px;
    }

    .dnp-inline .dnp-form-inner {
        padding: 24px 20px;
    }
}
