/* Site chrome shared by every page: the navy header and footer from the redesign. Palette tokens live in layout.html (:root). */
body { font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif; }
h1, h2, h3, .h1, .h2, .h3 { font-family: 'Archivo', system-ui, sans-serif; font-stretch: 112%; letter-spacing: -.02em; }
/* Scores, standings and ratings line up in columns. */
.table, .badge, .match-board { font-variant-numeric: tabular-nums; }

/* Header */
.navbar-tfl { box-shadow: none !important; padding-top: .5rem; padding-bottom: .5rem; }
.navbar-tfl .navbar-brand { font-family: 'Archivo', system-ui, sans-serif; font-stretch: 115%; font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; gap: .6rem; }
.navbar-tfl .navbar-nav .nav-link { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-weight: 500; color: rgba(255, 255, 255, .78); border-bottom: 2px solid transparent; border-radius: 0; }
.navbar-tfl .navbar-nav .nav-link:hover, .navbar-tfl .navbar-nav .nav-link:focus { color: #fff; }
.navbar-tfl .navbar-nav .nav-link.active { color: #fff; border-bottom-color: var(--tfl-lime); }
.navbar-tfl .btn { border-radius: 999px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; }
.navbar-tfl .btn-tennis { font-weight: 700; padding-left: 1.25rem; padding-right: 1.25rem; }
.navbar-tfl .btn-outline-success { border-width: 1.5px; border-color: rgba(255, 255, 255, .35); }
/* Enter a result sits beside the hamburger below 1400px; once the menu is expanded it goes after it. */
/* A squeezed button wraps its label onto three lines; keep labels on one and let the row fit instead. */
.navbar-tfl .btn { white-space: nowrap; flex-shrink: 0; }
/* Below 768px the brand, Install, Enter a result and the hamburger share one row: Install goes icon-only (it keeps its aria-label). */
@media (max-width: 767.98px) {
    .navbar-tfl #pwaInstallButton span { display: none !important; }
}
@media (max-width: 374.98px) {
    .navbar-tfl .navbar-brand { font-stretch: 100%; font-size: 1.3rem; margin-right: .5rem; }
}
@media (min-width: 1400px) {
    .navbar-tfl .navbar-result { order: 5; margin-left: .5rem !important; margin-right: 0 !important; }
    /* Expanded, the whole menu shares one row: the short install label, and tighter links. */
    .navbar-tfl #pwaInstallButton span,
    .navbar-tfl .navbar-actions .btn-warning > .d-md-inline { display: none !important; }
    .navbar-tfl .navbar-nav .nav-link > .bi { display: none; }
    .navbar-tfl .navbar-nav .nav-link { padding-left: .45rem; padding-right: .45rem; }
    .navbar-tfl .navbar-brand { margin-right: .75rem; }
    /* An admin with every alert button showing still runs out of room: wrap to a second row, never off the edge. */
    .navbar-tfl > .container { flex-wrap: wrap; row-gap: .25rem; }
}
.navbar-tfl .navbar-toggler { border-color: rgba(255, 255, 255, .35); border-radius: 12px; }
.navbar-tfl .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(216, 245, 60, .45); }
.navbar-tfl .navbar-collapse.show, .navbar-tfl .navbar-collapsing { padding-bottom: .5rem; }

/* Footer */
.footer { padding: 64px 0 32px; margin-top: 64px; font-size: 1rem; }
.footer .h5 { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; margin-bottom: 1rem; }
.footer p { color: rgba(255, 255, 255, .78); max-width: 420px; }
.footer .h6 { font-family: 'Archivo', system-ui, sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tfl-lime); margin-bottom: .5rem; }
.footer .list-unstyled li { margin: 0; }
.footer .list-unstyled a { display: inline-flex; align-items: center; min-height: 40px; color: rgba(255, 255, 255, .85) !important; text-decoration: none; }
.footer .list-unstyled a:hover { color: #fff !important; text-decoration: underline; text-underline-offset: 4px; }
.footer hr { margin-top: 2rem; opacity: .14; }
.footer .text-center { color: rgba(255, 255, 255, .65); }
.footer a:focus-visible { outline: 3px solid var(--tfl-lime); outline-offset: 3px; }

/* ===== Redesign theme for the rest of the app =====
   Pages outside the home page are plain Bootstrap (breadcrumb, .card, .table, .btn, forms), so the
   new look is applied to those components here rather than page by page. Palette tokens: layout.html. */
:root {
    --tfl-radius: 20px;
    --tfl-soft: #e7e5da;
    --bs-body-font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: var(--tfl-navy);
    --bs-border-color: var(--tfl-line);
    --bs-link-color: var(--tfl-navy);
    --bs-link-color-rgb: 14, 31, 61;
    --bs-link-hover-color: #1c5da6;
    --bs-link-hover-color-rgb: 28, 93, 166;
    --bs-secondary-color: var(--tfl-muted);
    --bs-success: var(--tfl-navy);
    --bs-success-rgb: 14, 31, 61;
}
body { line-height: 1.5; }
h4, h5, h6, .h4, .h5, .h6 { font-family: 'Archivo', system-ui, sans-serif; letter-spacing: -.015em; font-weight: 800; }
h1, .h1 { font-weight: 800; letter-spacing: -.03em; }
.text-muted { color: var(--tfl-muted) !important; }
main a:not(.btn):not(.dropdown-item):not(.nav-link):not(.list-group-item):not(.page-link) { text-underline-offset: 3px; }

/* Breadcrumb: quiet uppercase trail */
.breadcrumb { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem; }
.breadcrumb a { color: var(--tfl-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--tfl-navy); text-decoration: underline; }
.breadcrumb-item.active { color: var(--tfl-navy); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--tfl-muted); }

/* Cards: big radius, paper border, navy title band with a lime rule */
.card { --bs-card-border-color: var(--tfl-line); --bs-card-border-radius: var(--tfl-radius); --bs-card-inner-border-radius: calc(var(--tfl-radius) - 1px); box-shadow: none; background: #fff; }
.card-header { background: var(--tfl-navy); color: #fff; border-bottom: 3px solid var(--tfl-lime); padding: 1rem 1.5rem; }
/* Muted text and plain links would be navy-on-navy; headers that set their own bg-* keep Bootstrap's colors. */
.card-header:not([class*="bg-"]) .text-muted, .card-header:not([class*="bg-"]) .text-secondary { color: rgba(255, 255, 255, .72) !important; }
.card-header:not([class*="bg-"]) a:not(.btn) { color: #fff; }
.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6,
.card-header .h1, .card-header .h2, .card-header .h3, .card-header .h4, .card-header .h5, .card-header .h6 { color: inherit; font-weight: 800; }
.card-header[class*="bg-"] { border-bottom: 0; }
/* A navy skill-level pill (4.5, 5.0) on a navy header still needs an edge to read as a pill. */
.card-header:not([class*="bg-"]) .badge { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); }
.card .card .card-header { border-bottom-width: 0; }
.card-title a, .card-header a:not(.btn) { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-body { padding: 1.5rem; }
.card-footer { background: var(--bs-body-bg); border-top: 1px solid var(--tfl-soft); }
.card.border-success, .card.border-primary { border-color: var(--tfl-navy) !important; }

/* Buttons: pills */
.btn, .btn-sm, .btn-lg { --bs-btn-border-radius: 999px; }
.btn { font-weight: 600; padding-left: 1.1rem; padding-right: 1.1rem; }
.btn-sm { padding-left: .8rem; padding-right: .8rem; }
.btn-lg { padding-left: 1.6rem; padding-right: 1.6rem; }
.btn-group-vertical > .btn { --bs-btn-border-radius: 16px; }
/* Segmented filters (All / Active / Upcoming / Completed) must fit a 320px phone in one row. */
@media (max-width: 575.98px) {
    .btn-group > .btn { padding-left: .6rem; padding-right: .6rem; font-size: .92rem; }
}
.input-group > .btn { --bs-btn-border-radius: 12px; }
.btn-tennis { background: var(--tfl-lime); border-color: var(--tfl-lime); color: var(--tfl-navy); font-weight: 700; }
.btn-tennis:hover, .btn-tennis:focus { background: #c6e32a; border-color: #c6e32a; color: var(--tfl-navy); }
.btn-success, .btn-primary { background-color: var(--tfl-navy); border-color: var(--tfl-navy); color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-primary:hover, .btn-primary:focus { background-color: #1a3563; border-color: #1a3563; color: #fff; }
.btn-outline-success, .btn-outline-primary { color: var(--tfl-navy); border-color: var(--tfl-navy); border-width: 1.5px; --bs-btn-color: var(--tfl-navy); --bs-btn-border-color: var(--tfl-navy); --bs-btn-hover-bg: var(--tfl-navy); --bs-btn-hover-border-color: var(--tfl-navy); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--tfl-navy); --bs-btn-active-border-color: var(--tfl-navy); }
.btn-outline-success:hover, .btn-check:checked + .btn-outline-success, .btn-outline-success.active { background-color: var(--tfl-navy); border-color: var(--tfl-navy); color: #fff; }
/* Lime is ~1.2:1 against white, so light surfaces get a navy ring; navy surfaces keep lime. */
.btn:focus-visible, .btn-check:focus-visible + .btn { box-shadow: 0 0 0 .15rem #fff, 0 0 0 .32rem var(--tfl-navy); outline: 0; }
.navbar-tfl .btn:focus-visible, .footer .btn:focus-visible, .card-header:not([class*="bg-"]) .btn:focus-visible, .modal-header .btn:focus-visible, .hero-section .btn:focus-visible { box-shadow: 0 0 0 .22rem var(--tfl-lime); }
.card-header .btn-light { background: var(--tfl-lime); border-color: var(--tfl-lime); color: var(--tfl-navy); font-weight: 700; }
.card-header .btn-light:hover { background: #c6e32a; border-color: #c6e32a; }
.card-header .btn-outline-light { border-width: 1.5px; }
.bg-tennis, .bg-success.bg-opacity-100 { background-color: var(--tfl-navy) !important; }
.text-success { color: #2f6b13 !important; }

/* Forms */
.form-control, .form-select { border: 1.5px solid var(--tfl-line); border-radius: 12px; min-height: 44px; background-color: #fff; }
textarea.form-control { min-height: 0; }
.form-control-sm, .form-select-sm { min-height: 34px; border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--tfl-navy); box-shadow: 0 0 0 .22rem rgba(14, 31, 61, .25); }
.form-label { font-weight: 600; margin-bottom: .35rem; }
.form-text { color: var(--tfl-muted); }
.form-check-input:checked { background-color: var(--tfl-navy); border-color: var(--tfl-navy); }
.form-check-input:focus { border-color: var(--tfl-navy); box-shadow: 0 0 0 .22rem rgba(14, 31, 61, .25); }
.form-switch .form-check-input:checked { background-color: var(--tfl-navy); }
.input-group-text { background: var(--tfl-bg); border: 1.5px solid var(--tfl-line); border-radius: 12px; }

/* Tables: navy header, paper hairlines */
.table { --bs-table-border-color: var(--tfl-soft); --bs-table-striped-bg: rgba(245, 244, 238, .7); --bs-table-hover-bg: rgba(216, 245, 60, .14); }
.table thead th { background-color: var(--tfl-navy); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 0; vertical-align: middle; }
.table thead th:first-child { border-top-left-radius: 12px; }
.table thead th:last-child { border-top-right-radius: 12px; }
.table-responsive { border-radius: 12px; }
.table > :not(caption) > * > * { padding-top: .8rem; padding-bottom: .8rem; }
.table a:not(.btn) { font-weight: 600; }

/* Badges, alerts, list groups, tabs, pagination, modals, dropdowns */
/* Pill badges; a long one (a tournament section's counts) wraps on a narrow phone instead of overflowing. */
.badge { border-radius: 999px; font-weight: 700; padding: .4em .7em; max-width: 100%; white-space: normal; }
.badge.bg-success, .badge.bg-primary, .badge-scheduled, .badge-active { background-color: var(--tfl-navy) !important; }
.badge.bg-warning { background-color: #ffd23f !important; color: var(--tfl-navy) !important; }
.badge-upcoming { background-color: #ffd23f; color: var(--tfl-navy); }
.badge-completed { background-color: #6b7280; }
.alert { border-radius: 16px; border-width: 1.5px; }
.alert-success { background: #f0f9d0; border-color: #cfe86a; color: #26340a; }
.alert-info { background: #e8eef9; border-color: #bccbe6; color: var(--tfl-navy); }
.alert-warning { background: #fff4cc; border-color: #f0d36a; color: #4a3a00; }
.list-group { border-radius: 16px; }
.list-group-item { border-color: var(--tfl-soft); }
.list-group-item.active { background: var(--tfl-navy); border-color: var(--tfl-navy); color: #fff; }
.nav-pills .nav-link { border-radius: 999px; color: var(--tfl-navy); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--tfl-navy); color: #fff; }
.nav-tabs { border-bottom-color: var(--tfl-line); }
.nav-tabs .nav-link { color: var(--tfl-muted); font-weight: 600; border-radius: 12px 12px 0 0; }
.nav-tabs .nav-link.active { color: var(--tfl-navy); border-color: var(--tfl-line) var(--tfl-line) #fff; border-bottom: 3px solid var(--tfl-lime); }
.page-link { color: var(--tfl-navy); border-color: var(--tfl-line); }
.page-item.active .page-link { background: var(--tfl-navy); border-color: var(--tfl-navy); color: #fff; }
.modal-content { border: 0; border-radius: 24px; overflow: hidden; }
.modal-header.bg-success, .modal-header.bg-tennis { background-color: var(--tfl-navy) !important; border-bottom: 3px solid var(--tfl-lime); }
.dropdown-menu { border: 1px solid var(--tfl-line); border-radius: 16px; box-shadow: 0 12px 30px rgba(14, 31, 61, .14); padding: .5rem; }
.dropdown-item { border-radius: 10px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--tfl-bg); }
.progress { border-radius: 999px; background: var(--tfl-soft); }
.progress-bar { background-color: var(--tfl-navy); }
.hero-section { background: var(--tfl-navy); border-bottom: 4px solid var(--tfl-lime); }
.hero-section h1, .hero-section .display-4, .hero-section .display-5 { font-family: 'Archivo', system-ui, sans-serif; font-weight: 800; letter-spacing: -.035em; }
.contact-info { border-radius: 16px; border: 1px solid var(--tfl-line); background: var(--tfl-bg); }
/* Profile: the phone number with its prefilled Text link beside it. */
.contact-phone { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
/* The home page's round Text icon, beside a phone number wherever one is listed. */
.contact-sms-icon { flex: none; width: 36px; height: 36px; border-radius: 999px; background: var(--tfl-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; text-decoration: none; vertical-align: middle; margin-left: .4rem; }
.contact-sms-icon:hover, .contact-sms-icon:focus { background: #1a3563; color: #fff; }
.contact-phone .contact-sms-icon { margin-left: 0; }
.member-card { border-radius: var(--tfl-radius); }

@media (max-width: 575.98px) {
    .card-header { padding: .85rem 1rem; }
    .card-body { padding: 1.1rem; }
}

/* Accordions (FAQ, rules) */
.accordion { --bs-accordion-border-color: var(--tfl-line); --bs-accordion-border-radius: 16px; --bs-accordion-inner-border-radius: 15px; --bs-accordion-active-bg: var(--tfl-lime); --bs-accordion-active-color: var(--tfl-navy); --bs-accordion-btn-focus-box-shadow: 0 0 0 .22rem rgba(14, 31, 61, .25); --bs-accordion-btn-focus-border-color: var(--tfl-navy); }
.accordion-button { font-weight: 700; color: var(--tfl-navy); }
.accordion-button:not(.collapsed) { box-shadow: none; }

/* Ask Flex floats over every page. Leave room under the footer so the last line can always
   scroll clear of it, keep it off the phone's home indicator, and on a phone shrink it to an
   icon so it covers as little of a card as possible (the label stays for screen readers). */
body:has(.flex-chat-root) .footer { padding-bottom: 6.5rem; }
.flex-chat-root { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); }
/* A lime ring keeps the navy button visible over the navy header, hero and footer too. */
.flex-chat-toggle { box-shadow: 0 0 0 2px var(--tfl-lime), 0 .6rem 1.5rem rgba(8, 24, 50, .25); }
@media (max-width: 767.98px) {
    .flex-chat-root { right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
    .flex-chat-toggle { width: 52px; height: 52px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
    .flex-chat-toggle i { margin-right: 0; font-size: 1.3rem; }
    .flex-chat-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* The "turn on notifications" card (common/push-prompt.html). */
/* The spacing is the card's own, not its wrapper's: a hidden card (most of the time) must leave no gap. */
.push-prompt {
    display: flex; align-items: center; gap: 12px; margin: 16px 0;
    background: #0e1f3d; color: #fff;
    border-radius: 20px; padding: 12px 12px 12px 16px;
}
.push-prompt[hidden] { display: none; }
.push-prompt-icon { color: #d8f53c; font-size: 1.1rem; flex: none; }
.push-prompt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.push-prompt-text > strong { display: block; }
.push-prompt-text > span { font-size: .9rem; color: #dbe3ee; }
.push-prompt-status:not(:empty) { display: block; color: #d8f53c; }
.push-prompt .btn { flex: none; border-radius: 999px; }
.push-prompt .btn-close { filter: invert(1) grayscale(1) brightness(2); flex: none; }
.push-prompt .btn:focus-visible, .push-prompt .btn-close:focus-visible { outline: 3px solid #d8f53c; outline-offset: 2px; }
/* On a phone the button drops below the text, so the text keeps the card's width. */
@media (max-width: 575.98px) {
    .push-prompt { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
    .push-prompt-icon { margin-top: 2px; }
    .push-prompt-text { flex: 1 1 calc(100% - 80px); }
    .push-prompt .btn-close { order: 1; }
    .push-prompt [data-push-prompt-enable] { order: 2; margin-left: calc(1.1rem + 12px); }
}
