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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    max-width: 100vw;
    min-height: 100vh;
}

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

/* Logo centrado arriba */
.logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.logo {
    max-width: 200px;
    height: auto;
}



/* Selector de idioma en línea */
.language-switch {
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.lang-option {
    cursor: pointer;
    padding: 4px 6px;
    font-weight: 600;
    color: #4a5568;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
}

.lang-option:hover {
    background-color: #e2e8f0;
}

.lang-option.active {
    background-color: #4FD126; /* tu color verde */
    color: #ffffff;
}

.separator {
    margin: 0 6px;
    color: #a0aec0;
}

/* Título principal */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
    font-weight: 600;
    font-size: 28px;
}

/* Tarjeta blanca */
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

/* Image upload area */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-container {
    width: 100%;
    height: 260px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #718096;
    padding: 20px;
}

.placeholder svg {
    margin-bottom: 16px;
    color: #a0aec0;
}

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Botones */
.buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #4a5568;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 16px;
}

.button:hover {
    background-color: #2d3748;
}

.button:active {
    transform: translateY(1px);
}

.button:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

.camera-button {
    background-color: #4299e1;
}

.camera-button:hover {
    background-color: #3182ce;
}

.upload-button {
    background-color: #48bb78;
}

.upload-button:hover {
    background-color: #38a169;
}

.scan-button {
    background-color: #ed8936;
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
}

.scan-button:hover:not(:disabled) {
    background-color: #dd6b20;
}

.download-button {
    background-color: #667eea;
}

.download-button:hover {
    background-color: #5a67d8;
}

.new-scan-button {
    background-color: #e53e3e;
}

.new-scan-button:hover {
    background-color: #c53030;
}

/* Loading */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Messaging */
.error-container {
    display: none;
    background-color: #fff5f5;
    border-left: 4px solid #e53e3e;
    margin-bottom: 24px;
    padding: 16px;
    text-align: center;
}

.error-icon {
    margin: 0 auto 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #fed7d7;
}

.error-icon svg {
    color: #e53e3e;
}

.error-container h3 {
    color: #e53e3e;
    margin-bottom: 8px;
    font-size: 18px;
}

.error-container p {
    margin-bottom: 16px;
    color: #4a5568;
}

.error-container .button {
    background-color: #e53e3e;
    margin: 0 auto;
}

.error-container .button:hover {
    background-color: #c53030;
}

/* Results */
.result-container {
    display: none;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 24px;
}

.result-container h2 {
    margin-bottom: 16px;
    color: #2d3748;
    text-align: center;
}

.contact-info {
    margin-bottom: 20px;
}

.contact-field {
    margin-bottom: 12px;
    line-height: 1.5;
}

.field-name {
    font-weight: 600;
    color: #4a5568;
}

.field-value {
    word-break: break-word;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        padding: 16px;
    }

    h1 {
        font-size: 24px;
    }

    .preview-container {
        height: 220px;
    }

    .button {
        padding: 10px 12px;
        font-size: 14px;
    }
}
