/* =============================================
   CDG Modal Overlay
   ============================================= */

.cdg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
}

.cdg-modal-overlay[hidden] {
    display: none;
}

body.cdg-modal-open {
    overflow: hidden;
}

/* =============================================
   Modal Dialog
   ============================================= */

.cdg-modal-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 2.5rem);
    position: relative;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cdg-modal-eyebrow {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* =============================================
   Close Button
   ============================================= */

.cdg-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: #555;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.cdg-modal-close:hover,
.cdg-modal-close:focus {
    background: #f0f0f0;
    color: #111;
    outline: none;
}

/* =============================================
   Modal Typography
   ============================================= */

.cdg-modal-title {
    margin: 0 0 0.25rem;
    font-size: 1.45rem;
    line-height: 1.3;
}

.cdg-modal-intro {
    margin: 0 0 0.9rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.55;
}

.cdg-modal-filename {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: #0f172a;
    font-weight: 600;
    word-break: break-all;
}

/* =============================================
   Gate Form
   ============================================= */

.cdg-gate-form p {
    margin: 0 0 1rem;
}

.cdg-gate-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

.cdg-gate-form input[type="text"],
.cdg-gate-form input[type="email"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}

.cdg-gate-form input[type="text"]:focus,
.cdg-gate-form input[type="email"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
    outline: none;
}

.cdg-gate-form .cdg-is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.cdg-gate-consent-wrap {
    margin-top: 1.1rem;
}

.cdg-gate-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
    color: #334155;
}

.cdg-gate-consent-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex: 0 0 auto;
}

.cdg-gate-note {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.55;
}

.cdg-gate-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.cdg-gate-form button[type="submit"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.cdg-gate-form button[type="submit"]:hover,
.cdg-gate-form button[type="submit"]:focus {
    background: #135e96;
    outline: none;
}

.cdg-gate-form button[type="submit"]:disabled {
    background: #8cb4d5;
    cursor: not-allowed;
}

/* =============================================
   Error State
   ============================================= */

.cdg-gate-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.875rem;
    padding: 0.75rem 0.85rem;
    margin: 0;
}

.cdg-gate-error[hidden] {
    display: none;
}

/* =============================================
   Success Panel
   ============================================= */

.cdg-gate-success {
    text-align: center;
    padding: 1rem 0.5rem 0.5rem;
}

.cdg-gate-success[hidden] {
    display: none;
}

.cdg-gate-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.85rem;
}

.cdg-gate-success-title {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    color: #0f172a;
}

.cdg-gate-success-body {
    margin: 0 0 1.25rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.55;
}

.cdg-download-progress {
    margin: 0 0 1rem;
    text-align: left;
}

.cdg-download-progress[hidden] {
    display: none;
}

.cdg-download-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}

.cdg-download-progress-label {
    color: #334155;
    font-weight: 600;
}

.cdg-download-progress-text {
    color: #0f172a;
    font-weight: 700;
}

.cdg-download-progress-bar {
    width: 100%;
    height: 12px;
}

.cdg-download-progress-bar,
.cdg-download-progress-bar::-webkit-progress-bar {
    border-radius: 999px;
    background: #e2e8f0;
}

.cdg-download-progress-bar::-webkit-progress-value {
    border-radius: 999px;
    background: #2271b1;
}

.cdg-download-progress-bar::-moz-progress-bar {
    border-radius: 999px;
    background: #2271b1;
}

.cdg-download-fallback {
    margin: 0 0 1rem;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cdg-download-fallback[hidden] {
    display: none;
}

.cdg-download-fallback-link {
    color: #135e96;
    text-decoration: underline;
    font-weight: 600;
}

.cdg-download-fallback-link:hover,
.cdg-download-fallback-link:focus {
    color: #0f4c78;
    outline: none;
}

.cdg-download-expired {
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: left;
}

.cdg-download-expired[hidden] {
    display: none;
}

/* =============================================
   Deletion Link
   ============================================= */

.cdg-deletion-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
}

.cdg-deletion-wrap[hidden] {
    display: none;
}

.cdg-deletion-label {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.4;
}

.cdg-deletion-link {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    border: 1px solid #dc2626;
    background: #fff;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.cdg-deletion-link:hover,
.cdg-deletion-link:focus {
    background: #fef2f2;
    outline: none;
}

