:root {
    color-scheme: light;
    --purple-700: #673ab7;
    --purple-600: #7c5dd4;
    --purple-200: #e7ddff;
    --neutral-50: #f7f5ff;
    --neutral-900: #1a1330;
    --border-color: #e0e0e0;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--neutral-50);
    color: var(--neutral-900);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.page {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) 1.5rem 4rem;
}

.hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hero img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    display: block;
    background: #fff;
}

/* Buscador (igual al de normativa) */
.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 0.9rem;
    padding: 0 1rem;
    box-shadow: 0 4px 12px rgba(103, 58, 183, 0.08);
    height: 48px;
    margin-bottom: 2rem;
    border: 1px solid var(--purple-700);
    max-width: 400px;
}

.search-container input {
    border: none;
    outline: none;
    background: none;
    width: 100%;
    padding: 0.5rem;
    height: 100%;
    font-size: 1rem;
    font-family: inherit;
}

.search-icon {
    color: var(--purple-700);
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.search-clear {
    background: none;
    border: none;
    color: var(--purple-700);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.search-clear:hover {
    background: rgba(103, 58, 183, 0.1);
}

.search-container:focus-within {
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.3);
}

.highlight {
    background-color: #ffeb3b;
    color: #000;
    font-weight: 600;
}

/* Tarjetas */
.card {
    background: white;
    border-radius: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(103, 58, 183, 0.08);
    border: 1px solid rgba(103, 58, 183, 0.12);
    overflow: hidden;
}

.card-header {
    background: var(--purple-700);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
}

.list-group-flush {
    padding: 0;
    margin: 0;
    list-style: none;
}

.list-group-item-action {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--purple-700);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.list-group-item-action:hover {
    background: #f8f9fa;
    color: var(--purple-600);
}

.list-group-flush li:last-child .list-group-item-action {
    border-bottom: none;
}

/* Plazo en la misma línea; colores de urgencia de llamados_concurso_docente */
.plazo {
    font-weight: 700;
}

.urgency-high {
    color: #dc2626;
}

.urgency-medium {
    color: #b45309;
}

.urgency-low {
    color: #065f46;
}

/* Indicador de carga */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--purple-200);
    border-top-color: var(--purple-700);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2.4s;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Alerta pulsante a la derecha del plazo. Rojo #dc2626: contraste 4.8:1 sobre blanco. */
.icono-alerta {
    width: 1.15em;
    height: 1.15em;
    margin-left: 0.4rem;
    vertical-align: -0.2em;
    color: #dc2626;
    flex-shrink: 0;
    animation: pulso-alerta 1.6s ease-in-out infinite;
}

@keyframes pulso-alerta {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.18);
        opacity: 0.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .icono-alerta {
        animation: none;
    }
}

.error-msg {
    text-align: center;
    color: #b91c1c;
}

/* Botón volver a inicio */
.main-button-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.main-button {
    background: var(--purple-700);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 0.9rem;
    padding: 0.95rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 24px rgba(103, 58, 183, 0.25);
    min-width: 180px;
}

.main-button svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.main-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(103, 58, 183, 0.35);
}

.button-text-short {
    display: none;
}

@media (max-width: 640px) {
    .page {
        padding: 1.25rem 1rem 3rem;
    }

    .search-container {
        height: 44px;
        font-size: 0.95rem;
    }

    .card-header {
        padding: 0.85rem 1rem;
        font-size: 1.15rem;
    }

    .list-group-item-action {
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }

    .main-button {
        min-width: 140px;
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
    }

    .button-text-long {
        display: none;
    }

    .button-text-short {
        display: inline;
    }
}
