/* Inscrições (páginas Django). Usa as variáveis de style.css. */

.page-title {
    margin-bottom: 2rem;
    text-align: center;
}

.narrow {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.note {
    color: var(--text-secondary);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

/* Mensagens */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
    background: var(--surface);
}

.alert-success { border-left-color: #28a745; background: #eaf6ec; }
.alert-error { border-left-color: var(--error-color); background: #fbeaec; }
.alert-warning { border-left-color: var(--primary-color); background: #fdf6e0; }
.alert-info { border-left-color: var(--secondary-color); }

/* Formulários (complementa .form-group de style.css) */
.errorlist {
    list-style: none;
    color: var(--error-color);
    font-size: 0.9rem;
    margin: 0.25rem 0 0.5rem;
}

.help {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

fieldset.form-group {
    border: none;
}

fieldset.form-group legend {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

#id_addons label {
    display: flex;
    align-items: center;
    font-weight: 400;
}

.code-input {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-family: monospace;
}

/* Cards de competição e inscrição */
.meet-image {
    display: block;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.description p {
    margin-bottom: 0.75rem;
}

.details {
    margin-bottom: 1.5rem;
}

.details dt {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.details dd {
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
}

.addons-list {
    margin-left: 1.25rem;
}

.code-card {
    text-align: center;
}

.reg-code {
    font-family: monospace;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    line-height: 1.2;
    margin: 0.5rem 0 1rem;
    color: var(--primary-dark);
    overflow-wrap: anywhere;
}

.pix-qr {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 1rem auto;
}

.form-group textarea.pix-payload {
    min-height: 0;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* Meet cards keep a readable width instead of stretching one card across the page. */
.meet-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 380px));
    justify-content: center;
}

.pay-title {
    margin: 1.75rem 0 0.75rem;
}

.deadline-note {
    max-width: 640px;
    margin: 1.5rem auto 0;
    text-align: center;
}

/* Área da equipe */
.page-subtitle {
    margin: -1rem 0 1.5rem;
    text-align: center;
}

.page-subtitle form,
td form {
    display: inline;
}

/* "Sair" is a POST form; the button looks like a link. */
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: LinkText;
    text-decoration: underline;
    cursor: pointer;
}

.spaced {
    margin-bottom: 1rem;
}

.back-link {
    margin-top: 1.5rem;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

.cell-actions {
    display: flex;
    gap: 0.5rem;
}

.card .table-container {
    margin: 1rem 0;
}

.status-badge {
    white-space: nowrap;
}

.status-neutra {
    background: #e0e0e0;
    color: #333333;
}

.help ul {
    margin-left: 1.25rem;
}

.nowrap {
    white-space: nowrap;
}

/* Staff da competição (pesagem e conferência no celular) */
.st-title {
    font-size: 1.6rem;
}

.st-count {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.st-count div {
    background: var(--surface);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
}

.st-count b {
    display: block;
    font-size: 1.5rem;
    line-height: 1.1;
}

.st-count small {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.st-count span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.st-count .st-warn { background: #fff4e0; }
.st-count .st-warn b { color: #b26a00; }

.st-search {
    width: 100%;
    font: inherit;
    padding: 0.75rem 0.9rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    margin-bottom: 0.6rem;
}

.st-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.st-chips a {
    border: 1px solid #ccc;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.st-chips a.st-on {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-light);
}

.st-group {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 1.1rem 0 0.3rem;
}

.st-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    min-height: 3.5rem;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.45rem;
    color: inherit;
    text-decoration: none;
}

.st-row:hover { border-color: var(--primary-color); }
.st-row > div:first-child { min-width: 0; }
.st-n { font-weight: 600; }

.st-c {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.st-s {
    text-align: right;
    font-size: 0.8rem;
    white-space: nowrap;
}

.st-s > * { display: block; }
.st-s b { font-size: 0.95rem; }

.st-go {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.st-ok { color: #1e7b34; }
.st-bad { color: #c62828; }
.st-pend { color: #b26a00; }
.st-mut { color: var(--text-secondary); }

/* Ficha do atleta */
.st-back { margin-bottom: 0.8rem; }

.st-head {
    background: var(--secondary-color);
    color: var(--text-light);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.st-head h1 {
    font-size: 1.3rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.st-head p {
    font-size: 0.85rem;
    color: #ddd;
}

.st-cat {
    display: inline-block;
    margin-top: 0.5rem;
    background: var(--primary-color);
    color: var(--secondary-color);
    font-weight: 700;
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
}

/* Disabled outside the meet period; min-width: 0 keeps the grids from overflowing on phones. */
.st-fields {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.st-sec {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 0.9rem;
    margin-bottom: 0.8rem;
}

.st-sec h2 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.st-big {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.st-big input {
    width: 9rem;
    font: inherit;
    font-size: 2rem;
    font-weight: 700;
    padding: 0.4rem 0.6rem;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
}

.st-big.st-out input { border-color: #c62828; }

.st-msg {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
}

.st-msg.st-ok { background: #e8f5e9; }
.st-msg.st-bad { background: #fdecea; }

/* One column per lift the athlete does (1 to 3) */
.st-grid {
    display: flex;
    gap: 0.5rem;
}

.st-f {
    flex: 1 1 0;
    min-width: 0;
}

.st-f label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.st-f input {
    width: 100%;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 0.5rem;
    border: 1px solid #bbb;
    border-radius: 8px;
}

.st-f small {
    display: block;
    font-size: 0.72rem;
    color: #b26a00;
    margin-top: 0.2rem;
}

.st-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    margin-top: 0.6rem;
    font-weight: 600;
}

.st-check input {
    flex: none; /* the long label would squeeze it */
    width: 1.4rem;
    height: 1.4rem;
}

/* Equipamento: radio inputs hidden behind their labels, coloured by :checked */
.st-seg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    overflow: hidden;
}

.st-seg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.st-seg label {
    padding: 0.8rem;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
}

.st-seg input[value="ok"]:checked + label { background: #1e7b34; color: #fff; }
.st-seg input[value="nok"]:checked + label { background: #c62828; color: #fff; }

.st-seg input:focus-visible + label {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
}

/* Django's Textarea renders rows="10"; two lines are enough for the reason. */
.st-sec textarea {
    display: block;
    width: 100%;
    height: 4.5rem;
    margin-top: 0.6rem;
    font: inherit;
    padding: 0.5rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    resize: vertical;
}

.st-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.st-save {
    display: block;
    width: 100%;
    font-size: 1.1rem;
    padding: 0.9rem;
    margin: 0.4rem 0 0.6rem;
}

.st-absent {
    text-align: center;
    margin-bottom: 1rem;
}

.st-absent .link-button {
    color: var(--text-secondary);
    padding: 0.5rem;
}

.st-hist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 1.1rem;
}

/* Link do OpenLifter */
.st-copy {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.st-copy input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 0.85rem;
    padding: 0.6rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    background: var(--surface);
}

.st-copy .btn { padding: 0.6rem 1rem; }
.st-copy .btn[hidden] { display: none; }
