/* ============================================================
   DG Checkout Modal
   ============================================================ */

.dg-co-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    display: none; /* shown by JS */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: dg-co-fadein 0.18s ease;
}

@keyframes dg-co-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.dg-co-modal {
    background: #ffffff;
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    animation: dg-co-slidein 0.2s ease;
}

@keyframes dg-co-slidein {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Close (×) button */
.dg-co-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.dg-co-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ── Header ── */
.dg-co-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dg-co-lock {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.dg-co-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    color: #111827;
}

.dg-co-product {
    font-size: 0.88rem;
    color: #6366f1;
    font-weight: 600;
    margin: 0;
}

/* ── Form ── */
.dg-co-field {
    margin-bottom: 0.25rem;
}

.dg-co-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: #374151;
}

.dg-co-field input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}

.dg-co-field input[type="email"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dg-co-hint {
    font-size: 0.775rem;
    color: #9ca3af;
    margin: 0.35rem 0 0;
}

/* Proceed button */
.dg-co-btn-primary {
    display: block;
    width: 100%;
    margin-top: 1.1rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: opacity 0.18s, transform 0.12s;
}

.dg-co-btn-primary:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}

.dg-co-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.dg-co-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Error message */
.dg-co-error {
    color: #dc2626;
    font-size: 0.82rem;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.1em;
    display: none;
}

/* ── Processing state ── */
.dg-co-processing {
    text-align: center;
    padding: 2rem 0;
    display: none;
}

.dg-co-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: dg-co-spin 0.7s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes dg-co-spin {
    to { transform: rotate(360deg); }
}

/* ── Licence key box ── */
.dg-co-key-box {
    background: #f0fdf4;
    border: 2px dashed #86efac;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 0.75rem 0 1rem;
}

.dg-co-key-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #16a34a;
    margin: 0 0 0.4rem;
}

.dg-co-key-value {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #14532d;
    word-break: break-all;
    margin: 0;
    letter-spacing: 2px;
}

/* ── Success state ── */
.dg-co-success {
    text-align: center;
    padding: 0.5rem 0;
    display: none;
}

.dg-co-success-icon {
    width: 60px;
    height: 60px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.dg-co-success h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 0.6rem;
}

.dg-co-success p {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.dg-co-close-btn {
    padding: 0.6rem 1.8rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s;
}

.dg-co-close-btn:hover {
    background: #e5e7eb;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .dg-co-modal {
        padding: 1.5rem;
        border-radius: 14px;
    }
}
