/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--white);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Card */
main {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-content i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 15px;
}

.upload-content h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.upload-content p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.file-info {
    display: block;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* File Selected */
.file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: 8px;
}

.file-selected i {
    font-size: 1.5rem;
    color: var(--primary);
}

.file-selected span {
    color: var(--dark);
    font-weight: 500;
    word-break: break-all;
}

.btn-remove {
    background: var(--danger);
    color: var(--white);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-remove:hover {
    background: #dc2626;
}

/* Form Group */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary);
}

.input-password {
    position: relative;
}

.input-password input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-password input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 5px;
}

.btn-toggle-password:hover {
    color: var(--gray-600);
}

/* Buttons */
.btn-converter {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-converter:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-converter:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading p {
    color: var(--gray-500);
}

/* Resultado */
.resultado {
    animation: fadeIn 0.5s ease;
}

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

.resultado-header {
    text-align: center;
    margin-bottom: 25px;
}

.resultado-header i {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 10px;
}

.resultado-header h3 {
    color: var(--dark);
}

/* Cert Info */
.cert-info {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cert-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.cert-info-item:last-child {
    border-bottom: none;
}

.cert-info-item .label {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.cert-info-item .value {
    color: var(--dark);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.cert-info-item .value.expirado {
    color: var(--danger);
}

.cert-info-item .value.valido {
    color: var(--success);
}

/* Arquivos Gerados */
.arquivos-gerados {
    margin-bottom: 20px;
}

.arquivos-gerados h4 {
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.arquivos-gerados h4 i {
    color: var(--primary);
}

.arquivos-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.arquivo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--gray-100);
    border-radius: 8px;
    transition: background 0.3s;
}

.arquivo-item:hover {
    background: var(--gray-200);
}

.arquivo-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.arquivo-info i {
    color: var(--success);
    font-size: 1.2rem;
}

.arquivo-info .nome {
    font-weight: 500;
    color: var(--dark);
}

.arquivo-info .descricao {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.btn-download {
    padding: 8px 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.btn-download:hover {
    background: var(--primary-dark);
}

/* Ações */
.acoes {
    display: flex;
    gap: 10px;
}

.btn-download-all {
    flex: 1;
    padding: 12px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-download-all:hover {
    background: var(--success-dark);
}

.btn-nova-conversao {
    flex: 1;
    padding: 12px;
    background: var(--gray-200);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-nova-conversao:hover {
    background: var(--gray-300);
}

/* Erro */
.erro {
    text-align: center;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.erro i {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 15px;
}

.erro p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

.btn-tentar-novamente {
    padding: 12px 25px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-tentar-novamente:hover {
    background: #dc2626;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 25px;
    color: var(--white);
}

footer p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

footer p i {
    margin-right: 5px;
}

.credits {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsivo */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .acoes {
        flex-direction: column;
    }
    
    .arquivo-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
    }
}
