/* ============================================================
   CrowNation License Manager — Portal Shortcode Styles
   ============================================================ */

.cnlm-portal {
    --cnlm-bg: #0b1120;
    --cnlm-card-bg: #151e2e;
    --cnlm-text: #ff2222;
    --cnlm-text-muted: #ff2222;
    --cnlm-primary: #e63946;
    --cnlm-primary-hover: #c1121f;
    --cnlm-border: #334155;
    --cnlm-success: #10b981;
    --cnlm-danger: #ef4444;
    --cnlm-radius: 16px;

    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cnlm-bg);
    color: var(--cnlm-text);
    border-radius: var(--cnlm-radius);
    padding: 40px 32px;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.cnlm-portal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(230, 57, 70, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

.cnlm-container {
    position: relative;
    z-index: 1;
}

/* ── Header ── */
.cnlm-header {
    text-align: center;
    margin-bottom: 28px;
}

.cnlm-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cnlm-brand-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(230, 57, 70, 0.4));
}

.cnlm-brand-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cnlm-primary);
    letter-spacing: 0.5px;
}

.cnlm-header h2 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cnlm-header p {
    color: var(--cnlm-text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* ── Mode Toggle ── */
.cnlm-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid var(--cnlm-border);
}

.cnlm-mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--cnlm-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cnlm-mode-btn.active {
    background: linear-gradient(135deg, var(--cnlm-primary), var(--cnlm-primary-hover));
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

/* ── Card ── */
.cnlm-card {
    background: var(--cnlm-card-bg);
    border: 1.5px solid var(--cnlm-border);
    border-radius: var(--cnlm-radius);
    padding: 24px;
    margin-bottom: 16px;
}

/* ── Form Group ── */
.cnlm-form-group {
    margin-bottom: 18px;
}

.cnlm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cnlm-text-muted);
}

.cnlm-form-group label .cnlm-req {
    color: var(--cnlm-primary);
}

.cnlm-form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #64748b;
}

/* ── Input ── */
.cnlm-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--cnlm-border);
    border-radius: 10px;
    color: var(--cnlm-text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.cnlm-input:focus {
    border-color: var(--cnlm-primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

select.cnlm-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8'%3E%3Cpath d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ── Buttons ── */
.cnlm-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.cnlm-btn-primary {
    background: linear-gradient(135deg, var(--cnlm-primary), var(--cnlm-primary-hover));
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.cnlm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4);
}

.cnlm-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--cnlm-border);
    color: var(--cnlm-text-muted);
}

.cnlm-btn-secondary:hover {
    border-color: var(--cnlm-primary);
    color: var(--cnlm-primary);
}

.cnlm-btn-block {
    display: block;
    width: 100%;
}

/* ── Steps ── */
.cnlm-step {
    display: none;
    animation: cnlmFadeIn 0.35s ease;
}

.cnlm-step.active {
    display: block;
}

.cnlm-hidden {
    display: none !important;
}

/* ── Error ── */
.cnlm-error-msg {
    color: var(--cnlm-danger);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

.cnlm-error-msg.show {
    display: block;
}

/* ── Ad Section ── */
.cnlm-adwrap {
    text-align: center;
}

.cnlm-timer {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
}

.cnlm-timer svg {
    width: 90px;
    height: 90px;
    transform: rotate(-90deg);
}

.cnlm-timer span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 800;
    color: var(--cnlm-primary);
}

.cnlm-ad-content {
    margin-top: 14px;
}

.cnlm-ad-script-box {
    min-height: 80px;
}

.cnlm-adph {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px;
    color: #64748b;
}

.cnlm-pulse {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cnlm-primary);
    animation: cnlmPulse 1.5s infinite;
}

/* ── Success ── */
.cnlm-ok {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--cnlm-success), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.cnlm-ok svg {
    width: 30px;
    height: 30px;
}

.cnlm-keybox {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--cnlm-border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    margin-bottom: 16px;
}

/* ── License Card ── */
.cnlm-lic-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--cnlm-border);
    border-radius: 10px;
    padding: 16px;
}

.cnlm-lic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--cnlm-border);
}

.cnlm-lic-row:last-child {
    border-bottom: none;
}

.cnlm-lic-label {
    font-size: 0.82rem;
    color: var(--cnlm-text-muted);
}

.cnlm-lic-val {
    font-weight: 700;
    color: var(--cnlm-text);
    text-align: right;
}

.cnlm-lic-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cnlm-lic-status.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--cnlm-success);
}

.cnlm-lic-status.expired {
    background: rgba(239, 68, 68, 0.12);
    color: var(--cnlm-danger);
}

/* ── OTP ── */
.cnlm-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}

.cnlm-otp-inputs .cnlm-input {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0;
}

/* ── Manage Panel ── */
.cnlm-mylic-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cnlm-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.cnlm-mylic-item:hover {
    border-color: var(--cnlm-primary);
}

.cnlm-mylic-key {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 1px;
    word-break: break-all;
}

.cnlm-mylic-meta {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--cnlm-text-muted);
    flex-wrap: wrap;
}

.cnlm-mylic-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cnlm-mylic-actions button {
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--cnlm-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--cnlm-text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.cnlm-mylic-actions button:hover {
    border-color: var(--cnlm-primary);
    color: var(--cnlm-primary);
}

/* ── Loading ── */
.cnlm-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(4px);
    z-index: 10;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    border-radius: var(--cnlm-radius);
}

.cnlm-loading.show {
    display: flex;
}

.cnlm-spin {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--cnlm-primary);
    border-radius: 50%;
    animation: cnlmSpin 0.8s linear infinite;
}

/* ── Animations ── */
@keyframes cnlmFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cnlmSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes cnlmPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* ── Responsive ── */
@media (max-width: 560px) {
    .cnlm-portal {
        padding: 28px 20px;
    }

    .cnlm-header h2 {
        font-size: 1.3rem;
    }

    .cnlm-card {
        padding: 18px;
    }

    .cnlm-otp-inputs .cnlm-input {
        width: 40px;
        height: 46px;
        font-size: 1.1rem;
    }

    .cnlm-lic-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* ── Tips Box ── */
.cnlm-tips {
    margin-top: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 14px;
}

.cnlm-tips-title {
    font-size: 14px;
    font-weight: 700;
    color: #818cf8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cnlm-tips-title::before {
    content: '💡';
    font-size: 16px;
}

.cnlm-tips-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cnlm-tips-list li {
    position: relative;
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 7px;
    padding-left: 18px;
}

.cnlm-tips-list li:last-child {
    margin-bottom: 0;
}

.cnlm-tips-list li strong {
    color: #e2e8f0;
    font-weight: 600;
}

.cnlm-tips-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: #818cf8;
    border-radius: 50%;
    opacity: 0.6;
}

/* ── Renew Modal ── */
.cnlm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cnlm-fade-in 0.2s ease;
}

@keyframes cnlm-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cnlm-modal {
    background: #151e2e;
    border: 1px solid #334155;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    overflow: hidden;
    animation: cnlm-slide-up 0.25s ease;
}

@keyframes cnlm-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cnlm-modal-header {
    padding: 18px 22px;
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid #334155;
}

.cnlm-modal-body {
    padding: 20px 22px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
}

.cnlm-renew-info {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px;
    margin-top: 10px;
}

.cnlm-renew-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 12px;
}

.cnlm-renew-row span {
    color: #94a3b8;
}

.cnlm-renew-row strong {
    color: #e2e8f0;
}

.cnlm-renew-row code {
    color: #fbbf24;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.cnlm-modal-actions {
    display: flex;
    gap: 8px;
    padding: 16px 22px;
    border-top: 1px solid #334155;
}

.cnlm-modal-actions .cnlm-btn {
    flex: 1;
    text-align: center;
}