/* =====================================================================
 * Araintel CTF — estilo Araintel: fondo blanco, negro, escala de grises,
 * bordes cuadrados (border-radius:0), bordes 2px negros.
 * Prefijo: .actf-
 * ===================================================================== */

.actf-wrap {
    box-sizing: border-box;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 64px;
    color: #000;
    font-family: inherit;
}

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

.actf-kicker {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #555;
    font-weight: 700;
}

/* ---- Landing: explicacion ---- */
.actf-landing-lead { margin: 0 0 26px; max-width: none; color: #333; font-size: 16px; line-height: 1.65; }
.actf-landing-lead p { margin: 0 0 12px; }
.actf-landing-lead p:last-child { margin-bottom: 0; }
.actf-landing-lead code { background: #f1f1f1; padding: 1px 6px; border: 1px solid #ddd; font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.actf-landing-lead a { color: #000; font-weight: 700; }

/* ---- Buscador AJAX ---- */
.actf-search { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; flex-wrap: wrap; }
.actf-search__input {
    flex: 1 1 320px; min-width: 0; border: 1px solid #d9d9d9; border-radius: 0;
    padding: 14px 16px; font-size: 16px; background: #fff; color: #000; font-family: inherit;
}
.actf-search__input:focus { outline: 2px solid #000; outline-offset: 2px; }
.actf-search__hint { font-size: 13px; color: #666; font-weight: 700; }
#actf-challenge-grid[aria-busy="true"] { opacity: .5; transition: opacity .15s ease; }
.actf-feed-empty { grid-column: 1 / -1; }

/* ---- Botones ---- */
.actf-btn {
    display: inline-block;
    border: 1px solid #d9d9d9;
    border-radius: 0;
    padding: 11px 20px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    background: #fff;
    color: #000;
    transition: background .15s ease, color .15s ease;
    line-height: 1.2;
}
.actf-btn:hover { background: #000; color: #fff; }
.actf-btn--solid { background: #000; color: #fff; }
.actf-btn--solid:hover { background: #fff; color: #000; }
.actf-btn--outline { background: #fff; color: #000; }
.actf-btn--wide { display: block; width: 100%; text-align: center; }
.actf-btn--sm { padding: 7px 12px; font-size: 12px; }

/* ---- Grid de cards ---- */
.actf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.actf-grid--challenges { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 980px) { .actf-grid, .actf-grid--challenges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .actf-grid, .actf-grid--challenges { grid-template-columns: 1fr; } }

.actf-card {
    position: relative;
    border: 1px solid #d9d9d9;
    background: #fff;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
}
.actf-card--official { box-shadow: 0 2px 12px rgba(0, 0, 0, .06); border-color: #bdbdbd; }
.actf-card__title { margin: 0 0 6px; font-size: 20px; font-weight: 800; line-height: 1.15; }
.actf-card__meta { margin: 0 0 14px; color: #666; font-size: 13px; }
.actf-card__stats {
    display: flex; gap: 18px; margin: auto 0 16px;
    padding-top: 14px; border-top: 1px solid #ddd; font-size: 14px; color: #333;
}
.actf-card__stats strong { font-size: 20px; color: #000; }

.actf-badge {
    display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; padding: 3px 8px; border: 1px solid #d9d9d9;
    margin-bottom: 12px;
}
.actf-badge--official { background: #000; color: #fff; }

/* ---- Detalle de torneo ---- */
.actf-back { margin: 0; font-size: 14px; }
.actf-back a { color: #000; text-decoration: none; font-weight: 700; }
.actf-back a:hover { text-decoration: underline; }

.actf-detail-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.actf-detail-title { margin: 0 0 10px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.actf-detail-lead { margin: 0 0 26px; max-width: 70ch; color: #333; font-size: 16px; line-height: 1.6; }
.actf-detail-lead code { background: #eee; padding: 1px 6px; border: 1px solid #ccc; }

.actf-scorebox {
    border: 1px solid #d9d9d9; padding: 10px 16px; text-align: center; background: #fff; min-width: 92px;
}
.actf-scorebox__num { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.actf-scorebox__label { display: block; font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.actf-scorebox--big { background: #000; }
.actf-scorebox--big .actf-scorebox__num { color: #fff; }
.actf-scorebox--big .actf-scorebox__label { color: #bbb; }

.actf-intro { margin: 0 0 20px; color: #333; }

/* ---- Formulario de flag (debajo de cada reto) ---- */
.actf-flag-form { display: flex; flex-direction: column; gap: 8px; }
.actf-flag-form--inline { margin-top: 14px; padding-top: 14px; border-top: 1px solid #ededed; }
.actf-flag-form .actf-btn { width: 100%; text-align: center; }
.actf-flag-input {
    width: 100%; border: 1px solid #ccc; border-radius: 0;
    padding: 11px 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: #fff; color: #000;
}
.actf-flag-input:focus { outline: 2px solid #555; outline-offset: 1px; }
.actf-flag-login { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid #ededed; font-size: 14px; color: #555; }
.actf-flag-login a { color: #000; font-weight: 700; }

/* ---- Card de reto ---- */
.actf-challenge { padding: 18px; }
.actf-challenge__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.actf-points {
    flex: none; border: 1px solid #d9d9d9; padding: 2px 8px; font-weight: 800; font-size: 13px; background: #fff;
}
.actf-challenge__img {
    margin: 12px 0; border: 1px solid #d9d9d9; overflow: hidden; aspect-ratio: 16 / 9; background: #f2f2f2;
}
.actf-challenge__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.actf-challenge:hover .actf-challenge__img img { transform: scale(1.03); }
.actf-challenge__desc { margin: 6px 0 12px; color: #333; font-size: 14px; line-height: 1.5; }
.actf-challenge__actions { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.actf-challenge__actions .actf-btn { width: 100%; text-align: center; font-size: 14px; padding: 9px 14px; overflow-wrap: anywhere; }
.actf-challenge.is-solved { border-color: #9a9a9a; }
.actf-solved-tag { margin: 12px 0 0; font-weight: 800; color: #000; }

.actf-challenge__meta { margin-top: 14px; padding-top: 12px; border-top: 1px solid #ddd; }
.actf-challenge__by, .actf-challenge__tourn { margin: 2px 0; font-size: 12.5px; color: #555; }
.actf-challenge__by strong { color: #000; }
.actf-challenge__tourn a { color: #000; font-weight: 700; text-decoration: underline; }

/* ---- Alertas ---- */
.actf-alert {
    border: 1px solid #d9d9d9; padding: 12px 16px; margin: 0 0 18px; font-weight: 600; background: #fff;
}
.actf-alert a { color: #000; }
.actf-alert--success { background: #000; color: #fff; }
.actf-alert--error { background: #fff; color: #000; border-color: #999; }
.actf-alert--info { background: #f2f2f2; }

/* ---- Tablas (ranking / dashboard) ---- */
.actf-table { width: 100%; border-collapse: collapse; border: 1px solid #d9d9d9; background: #fff; }
.actf-table th, .actf-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #ddd; font-size: 14px; }
.actf-table thead th { background: #000; color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.actf-table tbody tr:last-child td { border-bottom: 0; }

/* ---- Dashboard ---- */
.actf-dash-head {
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    border: 1px solid #d9d9d9; background: #fff; padding: 26px 24px; margin-bottom: 20px; flex-wrap: wrap;
}
.actf-dash-head h1 { margin: 4px 0 0; font-size: 30px; font-weight: 800; }
.actf-dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .actf-dash-cols { grid-template-columns: 1fr; } }

.actf-panel { border: 1px solid #d9d9d9; background: #fff; padding: 22px 22px; }
.actf-panel h2 { margin: 0 0 14px; font-size: 22px; font-weight: 800; }
.actf-panel h3 { margin: 22px 0 8px; font-size: 17px; font-weight: 800; }
.actf-muted { color: #777; font-size: 14px; }

.actf-form { display: flex; flex-direction: column; gap: 12px; }
.actf-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 14px; }
.actf-form input[type=text], .actf-form input[type=url], .actf-form input[type=number],
.actf-form textarea, .actf-form input[type=file] {
    border: 1px solid #d9d9d9; border-radius: 0; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; color: #000; width: 100%;
}
.actf-form textarea { resize: vertical; }

.actf-tournament-list, .actf-challenge-admin-list { list-style: none; margin: 0 0 8px; padding: 0; }
.actf-tournament-list li, .actf-challenge-admin-list li {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 0; border-bottom: 1px solid #e2e2e2;
}
.actf-tournament-list__name { font-weight: 700; }
.actf-statuschip { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border: 1px solid #d9d9d9; }
.actf-statuschip--publish { background: #000; color: #fff; }
.actf-statuschip--pending { background: #fff; color: #000; }
.actf-statuschip--draft { background: #e6e6e6; color: #555; border-color: #999; }

.actf-link { color: #000; font-weight: 700; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.actf-link--danger { color: #b30000; }

.actf-challenge-admin-list form { margin: 0; }
.actf-challenge-admin-list li > span { flex: 1 1 auto; }
