/* ============================================================
   Code Protected Link – Popup Styles
   ============================================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
    --cl-font:          'Inter', sans-serif;
    --cl-accent:        #6366f1;          /* Indigo */
    --cl-accent-hover:  #4f46e5;
    --cl-accent-light:  rgba(99, 102, 241, 0.12);
    --cl-bg:            rgba(15, 15, 25, 0.75);
    --cl-card-bg:       #ffffff;
    --cl-text:          #1e1b4b;
    --cl-muted:         #6b7280;
    --cl-border:        #e5e7eb;
    --cl-error:         #ef4444;
    --cl-error-bg:      rgba(239, 68, 68, 0.08);
    --cl-shadow:        0 25px 60px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.12);
    --cl-radius:        20px;
    --cl-transition:    0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Overlay ─────────────────────────────────────────────── */
.code-link-overlay {
    position:         fixed;
    inset:            0;
    z-index:          999999;
    display:          flex;
    align-items:      center;
    justify-content:  center;
    padding:          20px;
    background:       var(--cl-bg);
    backdrop-filter:  blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Hidden by default */
    opacity:          0;
    visibility:       hidden;
    transition:       opacity 0.3s ease, visibility 0.3s ease;
}

.code-link-overlay.is-visible {
    opacity:    1;
    visibility: visible;
}

/* ── Card ────────────────────────────────────────────────── */
.code-link-card {
    position:         relative;
    font-family:      var(--cl-font);
    background:       var(--cl-card-bg);
    border-radius:    var(--cl-radius);
    box-shadow:       var(--cl-shadow);
    padding:          40px 36px 36px;
    width:            100%;
    max-width:        420px;
    text-align:       center;

    transform:        scale(0.85) translateY(20px);
    opacity:          0;
    transition:       transform var(--cl-transition), opacity 0.25s ease;
}

.code-link-overlay.is-visible .code-link-card {
    transform: scale(1) translateY(0);
    opacity:   1;
}

/* ── Close button ────────────────────────────────────────── */
.code-link-close {
    position:    absolute;
    top:         14px;
    right:       16px;
    background:  transparent;
    border:      none;
    cursor:      pointer;
    font-size:   22px;
    line-height: 1;
    color:       var(--cl-muted);
    padding:     4px 8px;
    border-radius: 8px;
    transition:  background 0.2s, color 0.2s;
}

.code-link-close:hover {
    background: var(--cl-accent-light);
    color:      var(--cl-accent);
}

/* ── Icon / Captcha Image ────────────────────────────────── */
.code-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    margin: 0 auto 12px;
}

.code-link-captcha-img {
    display: block;
    width: 78px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.07));
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.code-link-card:hover .code-link-captcha-img {
    transform: scale(1.05);
}

/* ── Title ───────────────────────────────────────────────── */
.code-link-title {
    font-size:   1.4rem;
    font-weight: 700;
    color:       var(--cl-text);
    margin:      0 0 8px;
    line-height: 1.3;
}

/* ── Description ─────────────────────────────────────────── */
.code-link-description {
    font-size:   0.9rem;
    color:       var(--cl-muted);
    margin:      0 0 24px;
    line-height: 1.5;
}

/* ── Input wrap ──────────────────────────────────────────── */
.code-link-input-wrap {
    position: relative;
    margin-bottom: 8px;
}

/* ── Input ───────────────────────────────────────────────── */
.code-link-input {
    display:       block;
    width:         100%;
    box-sizing:    border-box;
    padding:       14px 18px;
    font-family:   var(--cl-font);
    font-size:     1.05rem;
    font-weight:   600;
    text-align:    center;
    letter-spacing: 4px;
    color:         var(--cl-text);
    background:    #f9fafb;
    border:        2px solid var(--cl-border);
    border-radius: 12px;
    outline:       none;
    transition:    border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.code-link-input:focus {
    border-color: var(--cl-accent);
    background:   #ffffff;
    box-shadow:   0 0 0 4px var(--cl-accent-light);
}

.code-link-input.is-error {
    border-color: var(--cl-error);
    background:   var(--cl-error-bg);
    box-shadow:   0 0 0 4px rgba(239, 68, 68, 0.12);
}

/* ── Guide link ──────────────────────────────────────────── */
.code-link-guide-wrap {
    margin-top: 6px;
    margin-bottom: 4px;
    text-align: center;
}

.code-link-guide-link {
    display:         inline-block;
    font-size:       0.85rem;
    font-weight:     500;
    color:           var(--cl-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition:      color 0.2s ease, opacity 0.2s ease;
}

.code-link-guide-link:hover {
    color:   var(--cl-accent-hover);
    opacity: 0.85;
}

/* ── Error message ───────────────────────────────────────── */
.code-link-error {
    font-size:    0.82rem;
    font-weight:  500;
    color:        var(--cl-error);
    margin:       6px 0 20px;
    min-height:   18px;
    text-align:   center;
    opacity:      0;
    transition:   opacity 0.2s;
}

.code-link-error.is-visible {
    opacity: 1;
}

/* ── Submit button ───────────────────────────────────────── */
.code-link-btn {
    display: block !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 13px 24px !important;
    font-family: var(--cl-font, 'Inter', sans-serif) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    letter-spacing: 0.3px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.code-link-btn:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45) !important;
}

.code-link-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

.code-link-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4), 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

/* ── Shake animation (wrong code) ────────────────────────── */
@keyframes cl-shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-8px); }
    30%       { transform: translateX(8px); }
    45%       { transform: translateX(-6px); }
    60%       { transform: translateX(6px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}

.code-link-input.is-shaking {
    animation: cl-shake 0.5s ease;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .code-link-card {
        padding: 32px 24px 28px;
    }
    .code-link-title {
        font-size: 1.2rem;
    }
}

/* ============================================================
   Copy-to-Clipboard (<pre> and [copy_text]) Styles
   ============================================================ */
pre.code-link-copy-box,
pre {
    position: relative;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 110px 14px 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.6;
    color: #1e293b;
    overflow-x: auto;
    margin: 16px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

pre.code-link-copy-box:hover,
pre:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

pre.code-link-copy-box code,
pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    font-family: inherit;
}

/* ── Copy button inside <pre> ────────────────────────────── */
.code-link-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-family: var(--cl-font, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    color: #475569;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    user-select: none;
}

.code-link-copy-btn:hover {
    color: var(--cl-accent, #6366f1);
    border-color: var(--cl-accent, #6366f1);
    background: #f8faff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.code-link-copy-btn:active {
    transform: translateY(0);
}

.code-link-copy-btn.is-copied {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.code-link-copy-btn svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    pre.code-link-copy-box,
    pre {
        padding: 12px 14px;
        padding-top: 42px;
    }
    .code-link-copy-btn {
        top: 6px;
        right: 6px;
    }
}

/* ============================================================
   Inline Protect Form Styles ([protected-form-1]..[protected-form-5])
   ============================================================ */
.code-form-card {
    position: relative;
    font-family: var(--cl-font, 'Inter', sans-serif);
    background: var(--cl-card-bg, #ffffff);
    border: 1.5px solid var(--cl-border, #e5e7eb);
    border-radius: var(--cl-radius, 20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    padding: 36px 32px 30px;
    width: 100%;
    max-width: 440px;
    margin: 24px auto;
    text-align: center;
    box-sizing: border-box;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.code-form-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.11), 0 6px 14px rgba(0, 0, 0, 0.06);
}

.code-form-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    margin: 0 auto 12px;
}

.code-form-captcha-img {
    display: block;
    width: 78px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.07));
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.code-form-card:hover .code-form-captcha-img {
    transform: scale(1.05);
}

.code-form-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cl-text, #1e1b4b);
    margin: 0 0 8px;
    line-height: 1.35;
}

.code-form-description {
    font-size: 0.9rem;
    color: var(--cl-muted, #6b7280);
    margin: 0 0 20px;
    line-height: 1.5;
}

.code-form-input-wrap {
    position: relative;
    margin-bottom: 8px;
}

.code-form-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 18px;
    font-family: var(--cl-font, 'Inter', sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 4px;
    color: var(--cl-text, #1e1b4b);
    background: #f9fafb;
    border: 2px solid var(--cl-border, #e5e7eb);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.code-form-input:focus {
    border-color: var(--cl-accent, #6366f1);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--cl-accent-light, rgba(99, 102, 241, 0.12));
}

.code-form-input.is-error {
    border-color: var(--cl-error, #ef4444);
    background: var(--cl-error-bg, rgba(239, 68, 68, 0.08));
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.code-form-input.is-shaking {
    animation: cl-shake 0.5s ease;
}

.code-form-guide-wrap {
    margin-top: 6px;
    margin-bottom: 4px;
    text-align: center;
}

.code-form-guide-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cl-accent, #6366f1);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.code-form-guide-link:hover {
    color: var(--cl-accent-hover, #4f46e5);
    opacity: 0.85;
}

.code-form-error {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--cl-error, #ef4444);
    margin: 6px 0 18px;
    min-height: 18px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.code-form-error.is-visible {
    opacity: 1;
}

.code-form-btn {
    display: block !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 13px 24px !important;
    font-family: var(--cl-font, 'Inter', sans-serif) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    letter-spacing: 0.3px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.code-form-btn:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45) !important;
}

.code-form-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

.code-form-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4), 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

/* ── Success state inside card ───────────────────────────── */
.code-form-success {
    margin-top: 10px;
    padding: 20px 18px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 14px;
    text-align: center;
    animation: cl-fade-in 0.35s ease;
}

@keyframes cl-fade-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.code-form-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #dcfce7;
    margin: 0 auto 12px;
}

.code-form-success-icon svg {
    width: 26px;
    height: 26px;
    color: #16a34a;
}

.code-form-success-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #166534;
    word-break: break-word;
}

.code-form-success-content p {
    margin: 0 0 10px;
}

.code-form-success-content p:last-child {
    margin-bottom: 0;
}

.code-form-success-content a {
    color: var(--cl-accent, #6366f1);
    font-weight: 600;
    text-decoration: underline;
}

.code-form-success-content strong {
    color: #14532d;
}

@media (max-width: 480px) {
    .code-form-card {
        padding: 28px 20px 24px;
        margin: 16px auto;
    }
    .code-form-title {
        font-size: 1.15rem;
    }
    .code-form-success {
        padding: 16px 14px;
    }
}


