@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans', sans-serif;
}

#cuerpo {
    background-color: #dde3ea;
    min-height: 100vh;
}

/* Tarjeta central */
.card-form {
    background: #f4f6f8;
    border-radius: 10px;
    padding: 2rem 2.5rem;
    box-shadow: 0 4px 18px rgba(60, 80, 100, 0.13);
    max-width: 440px;
    width: 100%;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #3b5068;
    margin-bottom: 1.4rem;
    letter-spacing: 0.03em;
    border-left: 4px solid #5b7fa6;
    padding-left: 0.6rem;
}

/* Grupos de campo */
.field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.85rem;
}

.field-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5b7fa6;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.3rem;
}

.field-group input {
    width: 100%;
    padding: 0.48rem 0.75rem;
    border: 1.5px solid #b8c8d8;
    border-radius: 6px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.95rem;
    color: #2d3e50;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.field-group input:focus {
    border-color: #5b7fa6;
    box-shadow: 0 0 0 3px rgba(91, 127, 166, 0.15);
}

/* Fila especial: input id + botón buscar */
.field-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.field-inline input {
    flex: 1;
}

/* ── BOTONES ── */
/* Color azul piedra base */
:root {
    --stone-blue:        #4a6d8c;
    --stone-blue-hover:  #3a5a78;
    --stone-blue-active: #2e4a63;
    --btn-text:          #ffffff;
}

.btn-stone {
    background-color: var(--stone-blue);
    color: var(--btn-text);
    border: none;
    border-radius: 6px;
    padding: 0.48rem 1.1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 0.18s, transform 0.1s, box-shadow 0.18s;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(74, 109, 140, 0.22);
}

.btn-stone:hover {
    background-color: var(--stone-blue-hover);
    box-shadow: 0 4px 12px rgba(74, 109, 140, 0.3);
}

.btn-stone:active {
    background-color: var(--stone-blue-active);
    transform: translateY(1px);
    box-shadow: none;
}

/* Botón buscar (más compacto, va junto al input) */
.btn-stone.btn-buscar {
    padding: 0.48rem 0.85rem;
}

/* Grupo de botones de acción */
.btn-group-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

.btn-group-actions .btn-stone {
    flex: 1;
    min-width: 90px;
    text-align: center;
}

/* Botón limpiar — tono más claro */
.btn-stone.btn-limpiar {
    background-color: #7a9db8;
}

.btn-stone.btn-limpiar:hover {
    background-color: #6589a3;
}

/* Contenedor centrado */
.flex-container {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Separador de mensajes */
.msg-area {
    text-align: center;
    color: #3b5068;
    font-size: 0.9rem;
    min-height: 1.4em;
    margin-top: 0.5rem;
}

/* ── CABECERA CON CERRAR SESIÓN ── */
.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.card-header-row .card-title {
    margin-bottom: 0;
    flex: 1;
}

.btn-cerrar-sesion {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #c0392b;
    background: transparent;
    border: 1.5px solid #c0392b;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.18s, color 0.18s;
}

.btn-cerrar-sesion:hover {
    background-color: #c0392b;
    color: #fff;
}

/* ── RESPONSIVE MÓVIL ── */
@media (max-width: 480px) {

    .flex-container {
        padding: 1rem 0;        /* sin margen lateral, la tarjeta llena la pantalla */
        align-items: flex-start;
    }

    .card-form {
        border-radius: 0;       /* sin bordes redondeados cuando ocupa toda la pantalla */
        padding: 1.5rem 1.2rem;
        box-shadow: none;
        min-height: 100vh;      /* ocupa el alto completo para que no quede cortado */
    }

    .card-title {
        font-size: 1.05rem;
        margin-bottom: 1.2rem;
    }

    .field-group label {
        font-size: 0.75rem;
    }

    .field-group input {
        font-size: 1rem;        /* evita el zoom automático de iOS al hacer foco */
        padding: 0.6rem 0.75rem;
    }

    .btn-stone {
        font-size: 0.95rem;
        padding: 0.6rem 1rem;
    }

    /* El botón Buscar queda debajo del input en pantallas muy angostas */
    .field-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-stone.btn-buscar {
        width: 100%;
        text-align: center;
    }

    .btn-group-actions {
        flex-direction: column;
    }

    .btn-group-actions .btn-stone {
        width: 100%;
    }
}
