/* Reset e base */
.cip-container * {
    box-sizing: border-box;
}

.cip-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}

.cip-title {
    text-align: center;
    color: #2c3e50 !important;
    margin-bottom: 30px;
    font-size: 26px;
    font-weight: 600;
}

.cip-field {
    margin-bottom: 20px;
}

.cip-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e !important;
    font-size: 14px;
}

.cip-field small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d !important;
    font-size: 12px;
}

.cip-field .file-count {
    display: block;
    margin-top: 8px;
    color: #27ae60 !important;
    font-weight: 500;
    font-size: 13px;
}

.cip-field input[type="file"],
.cip-field input[type="number"],
.cip-field select {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #2c3e50;
    box-sizing: border-box;
}

.cip-field input[type="file"]:focus,
.cip-field input[type="number"]:focus,
.cip-field select:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.cip-field input[type="file"]:hover,
.cip-field input[type="number"]:hover,
.cip-field select:hover {
    border-color: #bdc3c7;
}

.cip-field input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.cip-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: #3498db !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    box-sizing: border-box;
    max-width: 100%;
}

.cip-button:hover {
    background: #2980b9 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.cip-button:active {
    transform: translateY(0);
}

.cip-button:focus {
    outline: 3px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

.cip-button:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.cip-field .cip-button {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.cip-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    color: #3498db !important;
    font-size: 16px;
    font-weight: 500;
}

.cip-loader .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(52, 152, 219, 0.2);
    border-top: 3px solid #3498db !important;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cip-resultado {
    margin-top: 30px;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.5s ease-in-out;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cip-resultado h3 {
    margin: 0 0 20px 0;
    color: #2c3e50 !important;
    font-size: 20px;
    font-weight: 600;
}

.cip-info {
    margin: 0 0 15px 0;
    color: #34495e !important;
    font-size: 15px;
    text-align: center;
}

.cip-zip-download {
    margin: 20px 0 30px 0;
    text-align: center;
}

.cip-download-zip {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #27ae60 !important;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    animation: pulseZip 2s ease-in-out infinite;
}

.cip-download-zip:hover {
    background: #229954 !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

@keyframes pulseZip {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.cip-resultado.success {
    background: #e7f3ff !important;
    border: 2px solid #b3d9ff !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.cip-resultado.error {
    background: #fdedee !important;
    border: 2px solid #f5b7b1 !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

.cip-error {
    color: #c0392b !important;
    font-weight: 500;
    margin: 0;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
}

.cip-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cip-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 16px;
    background: #ffffff !important;
    border-radius: 8px;
    border: 2px solid #e3f2fd !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cip-result-item:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
    border-color: #90caf9 !important;
}

.cip-result-item:last-child {
    margin-bottom: 0;
}

.cip-result-item p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #2c3e50 !important;
    flex: 1;
    position: relative;
    padding-left: 32px;
    font-weight: 500;
}

.cip-result-item p::before {
    content: '\2714';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60 !important;
    font-size: 20px;
    font-weight: bold;
}

.cip-download {
    background: #0d6efd !important;
    padding: 10px 20px;
    margin-left: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    padding-left: 42px;
    transition: all 0.3s ease;
    color: #fff !important;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

.cip-download:hover {
    background: #0a58ca !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.cip-download::before {
    content: '\21E9';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #fff !important;
    font-weight: bold;
}

.cip-download:focus {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

/* Responsividade */
@media (max-width: 600px) {
    .cip-container {
        padding: 20px;
        margin: 20px 10px;
        max-width: calc(100% - 20px);
    }

    .cip-title {
        font-size: 22px;
    }
    
    .cip-button {
        padding: 12px 20px;
        font-size: 15px;
    }

    .cip-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cip-result-item p {
        padding-left: 28px;
        font-size: 14px;
    }

    .cip-download {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        padding-left: 20px;
    }

    .cip-download::before {
        left: 50%;
        margin-left: -60px;
    }
}

/* Acessibilidade - Modo de alto contraste */
@media (prefers-contrast: high) {
    .cip-container {
        border: 2px solid #000;
    }

    .cip-field input[type="file"],
    .cip-field input[type="number"],
    .cip-field select {
        border: 2px solid #000;
    }

    .cip-button {
        border: 2px solid #000;
    }
}

/* Modo escuro */
@media (prefers-color-scheme: dark) {
    .cip-container {
        background: #1e1e1e !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .cip-title,
    .cip-field label {
        color: #e0e0e0 !important;
    }

    .cip-field small,
    .cip-field .file-count {
        color: #b0b0b0 !important;
    }

    .cip-field input[type="file"],
    .cip-field input[type="number"],
    .cip-field select {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }

    .cip-resultado h3,
    .cip-result-item p {
        color: #e0e0e0 !important;
    }

    .cip-result-item {
        background: #2d2d2d !important;
        border-color: #404040 !important;
    }

    .cip-resultado.success {
        background: #1a3a4a !important;
        border-color: #2c5f7f !important;
    }

    .cip-resultado.error {
        background: #4a1a1a !important;
        border-color: #7f2c2c !important;
    }

    .cip-error {
        background: #2d2d2d;
        color: #ff6b6b !important;
        border-left-color: #ff4444;
    }
}