* { box-sizing: border-box; }

:root {
    --bg: #050607;
    --panel: rgba(14, 17, 20, 0.94);
    --panel-soft: rgba(23, 27, 31, 0.92);
    --red: #d12626;
    --red-dark: #690909;
    --white: #f2f2f2;
    --grey: #aeb3b8;
    --border: rgba(255,255,255,.11);
    --green: #3ad77b;
    --heading: "Anton", Impact, sans-serif;
    --body: "Oswald", Arial, sans-serif;
}

html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--white);
    background: var(--bg);
    font-family: var(--body);
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.page-background, .page-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
}
.page-background {
    z-index: -2;
    background:
        radial-gradient(circle at 82% 18%, rgba(209,38,38,.23), transparent 34%),
        radial-gradient(circle at 12% 72%, rgba(120,12,12,.17), transparent 38%),
        linear-gradient(135deg, #050607, #101315 48%, #060708);
}
.page-overlay {
    z-index: -1;
    background: linear-gradient(rgba(0,0,0,.08), rgba(0,0,0,.58));
}

.teams-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: rgba(5,7,8,.9);
    backdrop-filter: blur(16px);
}
.teams-header-inner {
    width: min(1450px, calc(100% - 36px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand-link img { display: block; width: 52px; height: 52px; object-fit: contain; }
.teams-nav { display: flex; align-items: center; gap: 22px; margin-right: auto; }
.teams-nav a {
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.teams-nav a:hover, .teams-nav a.active { color: #fff; }
.profile-link {
    min-height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255,255,255,.04);
}

main {
    width: min(1450px, calc(100% - 36px));
    margin: 0 auto;
    padding: 55px 0 85px;
}
.teams-hero {
    min-height: 275px;
    padding: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
    border: 1px solid rgba(209,38,38,.42);
    background:
        linear-gradient(110deg, rgba(209,38,38,.17), transparent 46%),
        var(--panel);
    box-shadow: 0 28px 80px rgba(0,0,0,.42);
}
.eyebrow {
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
}
.teams-hero h1, .modal-card h2, .state-panel h2 {
    margin: 8px 0 12px;
    font-family: var(--heading);
    font-weight: 400;
    line-height: .95;
}
.teams-hero h1 { font-size: clamp(64px, 9vw, 120px); }
.teams-hero p { max-width: 690px; margin: 0; color: var(--grey); font-size: 21px; line-height: 1.5; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; min-width: 210px; }

.primary-button, .secondary-button {
    min-height: 50px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 7px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
}
.primary-button {
    color: #fff;
    border: 1px solid #e24646;
    background: linear-gradient(145deg, var(--red), var(--red-dark));
}
.secondary-button {
    color: #fff;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.045);
}

.teams-toolbar {
    margin: 24px 0;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--border);
    background: var(--panel);
}
.search-box {
    width: min(540px, 100%);
    min-height: 48px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.33);
}
.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
}
.teams-counter { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.teams-counter strong { font-family: var(--heading); font-size: 31px; font-weight: 400; color: var(--red); }
.teams-counter span { color: var(--grey); font-size: 13px; letter-spacing: .08em; }

.state-panel {
    min-height: 260px;
    padding: 35px;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
}
.state-panel > ion-icon { font-size: 55px; color: var(--red); }
.state-panel p { margin: 0; color: var(--grey); font-size: 18px; }
.loader {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,.12);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.teams-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}
.team-card {
    min-height: 310px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: linear-gradient(150deg, var(--panel-soft), rgba(7,9,10,.98));
    transition: transform .2s ease, border-color .2s ease;
}
.team-card:hover { transform: translateY(-5px); border-color: rgba(209,38,38,.6); }
.team-card-top { display: flex; align-items: center; gap: 15px; }
.team-logo {
    width: 74px; height: 74px;
    display: grid; place-items: center;
    overflow: hidden;
    border: 1px solid rgba(209,38,38,.5);
    background: rgba(209,38,38,.1);
    font-family: var(--heading);
    font-size: 26px;
    color: #fff;
}
.team-logo img { width: 100%; height: 100%; object-fit: cover; }
.team-heading { min-width: 0; }
.team-heading h2 { margin: 0; font-family: var(--heading); font-size: 31px; font-weight: 400; overflow-wrap: anywhere; }
.team-heading span { color: var(--red); font-weight: 700; }
.team-description { flex: 1; margin: 22px 0; color: var(--grey); line-height: 1.55; }
.team-meta { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--border); }
.team-meta div { padding: 13px 5px; text-align: center; }
.team-meta strong { display: block; font-size: 20px; }
.team-meta span { color: var(--grey); font-size: 11px; }
.team-link {
    margin-top: 18px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.035);
    text-transform: uppercase;
    font-weight: 700;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.84); }
.modal-card {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 32px;
    border: 1px solid rgba(209,38,38,.6);
    background: #0b0e10;
    box-shadow: 0 30px 100px rgba(0,0,0,.75);
}
.modal-card h2 { font-size: 48px; }
.modal-intro { color: var(--grey); line-height: 1.5; }
.modal-close {
    position: absolute; top: 12px; right: 14px;
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    color: #fff; background: rgba(255,255,255,.04);
    font-size: 25px; cursor: pointer;
}
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; margin-top: 25px; }
.form-grid label, .full-field { display: grid; gap: 8px; }
.form-grid span, .full-field > span { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
input, textarea {
    width: 100%;
    outline: 0;
    color: #fff;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.38);
}
input { min-height: 48px; padding: 0 13px; }
textarea { min-height: 130px; padding: 13px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--red); }
.full-field { margin-top: 17px; }
.full-field small { justify-self: end; color: var(--grey); }
.form-message { min-height: 22px; color: var(--grey); }
.form-message.error { color: #ff7d86; }
.form-message.success { color: var(--green); }
.submit-button { width: 100%; }

@media (max-width: 950px) {
    .teams-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
    .teams-header-inner { width: calc(100% - 20px); min-height: 66px; }
    .teams-nav { display: none; }
    .profile-link { margin-left: auto; }
    main { width: calc(100% - 20px); padding-top: 24px; }
    .teams-hero { padding: 27px 20px; flex-direction: column; align-items: flex-start; }
    .teams-hero p { font-size: 18px; }
    .hero-actions { width: 100%; }
    .teams-toolbar { flex-direction: column; align-items: stretch; }
    .teams-counter { justify-content: center; }
    .teams-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .modal-card { padding: 26px 18px; }
}
