/* =============================================
   CAROLCHAT VOTING MODAL
   Two-step modal: vote type → wallet input
   Dark theme matching the existing UI
   ============================================= */

/* ---- Overlay ---- */
.cv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cv-modal-overlay.cv-visible {
    opacity: 1;
}

/* ---- Modal card ---- */
.cv-modal {
    background: #1B1C28;
    border: 1.5px solid #52D38E;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    box-sizing: border-box;
    font-family: 'DM Sans', 'Inter', -apple-system, sans-serif;
    color: #FFFFFF;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(82, 211, 142, 0.08);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.cv-modal-overlay.cv-visible .cv-modal {
    transform: translateY(0) scale(1);
}

/* ---- Close button ---- */
.cv-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #6B6D7E;
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.cv-modal-close:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

/* ---- Step containers ---- */
.cv-step {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.cv-step.cv-active {
    display: flex;
}

/* ---- Step 1: Vote type selection ---- */
.cv-modal-heading {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    margin: 0;
    color: #E8E8EC;
}

.cv-modal-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.cv-btn-anonymous,
.cv-btn-holder {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.cv-btn-anonymous {
    background: #52D38E;
    color: #1B1C28;
}

.cv-btn-anonymous:hover {
    background: #45b87a;
    transform: translateY(-1px);
}

.cv-btn-holder {
    background: rgba(82, 211, 142, 0.15);
    color: #52D38E;
    border: 1px solid #52D38E;
}

.cv-btn-holder:hover {
    background: rgba(82, 211, 142, 0.25);
    transform: translateY(-1px);
}

.cv-modal-footnote {
    font-size: 13px;
    color: #6B6D7E;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* ---- Step 2: Wallet input ---- */
.cv-wallet-heading {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    margin: 0;
    color: #E8E8EC;
}

.cv-wallet-form {
    display: flex;
    gap: 0;
    width: 100%;
    border: 1.5px solid #2E2F42;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cv-wallet-form:focus-within {
    border-color: #52D38E;
}

.cv-wallet-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: 'DM Sans', monospace;
    outline: none;
}

.cv-wallet-input::placeholder {
    color: #4A4B5C;
}

.cv-btn-continue {
    background: #52D38E;
    color: #1B1C28;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cv-btn-continue:hover:not(:disabled) {
    background: #45b87a;
}

.cv-btn-continue:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cv-wallet-link {
    font-size: 13px;
    color: #6B6D7E;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s;
}

.cv-wallet-link:hover {
    color: #52D38E;
}

.cv-btn-back {
    background: transparent;
    border: none;
    color: #6B6D7E;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
    font-family: inherit;
}

.cv-btn-back:hover {
    color: #FFFFFF;
}

/* ---- Success / Error feedback ---- */
.cv-feedback {
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    border-radius: 8px;
    display: none;
}

.cv-feedback.cv-success {
    display: block;
    color: #52D38E;
}

.cv-feedback.cv-error {
    display: block;
    color: #ef4444;
}

/* ---- Loading state ---- */
.cv-loading .cv-btn-anonymous,
.cv-loading .cv-btn-holder,
.cv-loading .cv-btn-continue {
    opacity: 0.5;
    pointer-events: none;
}

/* ---- Responsive ---- */
@media screen and (max-width: 480px) {
    .cv-modal {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .cv-modal-buttons {
        flex-direction: column;
    }

    .cv-modal-heading,
    .cv-wallet-heading {
        font-size: 16px;
    }
}
