/* =========================================================
   Featured competitions (News & Events, top of the page)
   ========================================================= */

.comp-featured {
    margin: 0 0 44px;
}

.comp-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 1.4rem;
    color: #2f3a17;
}

.comp-heading::before {
    content: "";
    width: 10px;
    height: 30px;
    border-radius: 5px;
    background: linear-gradient(#a4512f, #5b6b2f);
    flex: none;
}

.comp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.comp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fffdf8;
    border: 1px solid #e6dcc6;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(47, 58, 23, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.comp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(47, 58, 23, 0.22);
}

/* ---- hero band ---- */

.comp-hero {
    position: relative;
    padding: 24px 24px 22px;
    overflow: hidden;
    color: #ffffff;
}

.comp-iot .comp-hero {
    background: linear-gradient(135deg, #2f3a17 0%, #5b6b2f 60%, #7a844a 100%);
}

.comp-bin .comp-hero {
    background: linear-gradient(135deg, #6e2f17 0%, #a4512f 60%, #d9a35b 100%);
}

/* Moorish arch decoration */

.comp-hero::before,
.comp-hero::after {
    content: "";
    position: absolute;
    inset-inline-end: -36px;
    top: -36px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 24px solid rgba(255, 255, 255, 0.09);
    pointer-events: none;
}

.comp-hero::after {
    inset-inline-end: 40px;
    top: auto;
    bottom: -90px;
    width: 130px;
    height: 130px;
    border-width: 16px;
    border-color: rgba(255, 255, 255, 0.07);
}

.comp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.comp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f2b632;
    color: #2b2a22;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 5px 13px;
    border-radius: 999px;
}

.comp-badge i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2b2a22;
    animation: comp-pulse 1.8s ease-in-out infinite;
}

@keyframes comp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

.comp-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    display: grid;
    place-items: center;
    flex: none;
}

.comp-icon svg {
    width: 30px;
    height: 30px;
}

.comp-card .comp-title {
    position: relative;
    z-index: 1;
    margin: 16px 0 8px;
    font-size: 1.3rem;
    line-height: 1.5;
    color: #ffffff;
}

.comp-card .comp-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    line-height: 1.8;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
}

/* ---- chips ---- */

.comp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 24px 0;
}

.comp-chip {
    background: #f6f1e4;
    color: #4a4a2a;
    border: 1px solid #e6dcc6;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 12px;
}

/* ---- actions ---- */

.comp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 24px 0;
}

.comp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.comp-btn::-webkit-details-marker {
    display: none;
}

.comp-iot .comp-btn-main {
    background: #5b6b2f;
    color: #ffffff;
}

.comp-iot .comp-btn-main:hover {
    background: #2f3a17;
}

.comp-bin .comp-btn-main {
    background: #a4512f;
    color: #ffffff;
}

.comp-bin .comp-btn-main:hover {
    background: #6e2f17;
}

.comp-btn-ghost {
    background: transparent;
    color: #2f3a17;
    border-color: #c9bd9c;
}

.comp-btn-ghost:hover {
    background: #f6f1e4;
    border-color: #5b6b2f;
}

.comp-btn:focus-visible,
.comp-field input:focus-visible,
.comp-field select:focus-visible,
.comp-field textarea:focus-visible {
    outline: 3px solid #f2b632;
    outline-offset: 2px;
}

/* ---- registration panel ---- */

.comp-reg {
    padding: 0 24px 24px;
    margin-top: 16px;
}

.comp-reg > summary {
    display: inline-flex;
    margin: 0;
}


.comp-form {
    margin-top: 16px;
    padding: 18px;
    background: #f6f1e4;
    border: 1px solid #e6dcc6;
    border-radius: 14px;
    display: grid;
    gap: 14px;
}

.comp-field {
    display: grid;
    gap: 6px;
}

.comp-field label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #2f3a17;
}

.comp-field input,
.comp-field select,
.comp-field textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: #2b2a22;
    background: #ffffff;
    border: 1px solid #c9bd9c;
    border-radius: 8px;
}

.comp-field textarea {
    min-height: 96px;
    resize: vertical;
}

.comp-count {
    font-size: 0.78rem;
    color: #6b6b5a;
    text-align: end;
}

.comp-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.comp-submit {
    justify-self: start;
}

.comp-submit[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.comp-msg {
    margin: 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    display: none;
}

.comp-msg.ok {
    display: block;
    background: #e3f1e6;
    color: #1e5a33;
    border: 1px solid #a9d3b4;
}

.comp-msg.err {
    display: block;
    background: #fbe7e4;
    color: #8a2b1d;
    border: 1px solid #e8b5ac;
}

@media (max-width: 820px) {
    .comp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .comp-hero,
    .comp-meta,
    .comp-actions {
        padding-inline: 16px;
    }

    .comp-reg {
        padding-inline: 16px;
    }

    .comp-btn {
        width: 100%;
    }

    .comp-submit {
        justify-self: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .comp-card,
    .comp-btn {
        transition: none;
    }

    .comp-badge i {
        animation: none;
    }

    .comp-card:hover {
        transform: none;
    }
}
