body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: center;
}

header {
    background-color: #333;
    color: white;
    padding: 10px 0;
    text-align: center;
}

h1, h3 {
    margin-top: 30px;
    color: #2c3e50;
}

.container {
    background-color: white;
    padding: 30px;
    margin: 30px auto;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.form-group label {
    width: 160px;
    text-align: left;
    font-weight: bold;
}

.form-group input,
input {
    flex: 1;
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

input:focus,
.int_inputs:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    outline: none;
    background-color: #fff;
}

.int_inputs {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #f9fbfc;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.buttons {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

.buttons button,
button {
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px;
    font-size: 16px;
    width: 100%;
}

.buttons button:hover,
button:hover {
    background-color: #2980b9;
}

.volver {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    width: 74px;
}

.volver:hover {
    background-color: #c0392b;
}

canvas {
    display: block;
    margin: 20px auto;
    border: 1px solid #000;
    background-color: #fff;
}

.results {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

.road {
    width: 90%;
    height: 14px;
    background-color: #7f8c8d;
    margin: 20px auto;
    border-radius: 5px;
    position: relative;
}

.car {
    width: 40px;
    height: 20px;
    background-color: #1abc9c;
    border-radius: 5px;
    position: absolute;
    top: -10px;
    left: 0;
    transition: none;
}

.arrow {
    font-size: 28px;
    position: absolute;
    top: -40px;
    left: 10px;
    display: none;
}

.ruler {
    display: flex;
    justify-content: space-between;
    width: 90%;
    margin: 10px auto;
    font-size: 14px;
}

.info {
    margin-top: 20px;
    font-size: 18px;
    color: #2d3436;
}

.grafico {
    display: block;
    margin: 30px auto;
    border: 2px solid #2c3e50;
    background-color: #ecf0f1;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.grafico:hover {
    box-shadow: 0 6px 14px rgba(0,0,0,0.3);
    transform: scale(1.01);
}
