:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #005b9f; /* Azul marino corporativo (estilo Medtronic) */
    --accent-hover: #004b87;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Inter', sans-serif;
    /* Fondo claro con un degradado muy sutil y limpio */
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.selector-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selector-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-select {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Flecha en color gris suave */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.custom-select:hover, .custom-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 91, 159, 0.15);
}

.custom-select option {
    background-color: #ffffff;
    color: var(--text-primary);
}

.header-title {
    text-align: right;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.app-content {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.welcome-message {
    text-align: center;
    max-width: 500px;
    animation: fadeIn 0.5s ease-out forwards;
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-weight: 700;
}

.welcome-message p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.05rem;
}

.protocol-form {
    width: 100%;
    animation: slideUp 0.4s ease-out forwards;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-title {
    font-size: 1.75rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .header-title {
        text-align: left;
    }
}

/* Form Fields */
.split-layout {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
    align-items: stretch;
}

.fields-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 33.333%;
    align-self: flex-start;
}

.result-container {
    width: 66.666%;
    display: flex;
    flex-direction: column;
}

.result-textarea {
    flex-grow: 1;
    min-height: 400px;
}

@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
    }
    .fields-container,
    .result-container {
        width: 100%;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.width-33 {
    width: calc(33.333% - 1rem);
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
}

.form-input {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.form-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 91, 159, 0.15);
}

.placeholder-text {
    padding: 2rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    color: var(--text-secondary);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 91, 159, 0.2);
    align-self: flex-start;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 6px 8px -1px rgba(0, 91, 159, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
