/* Troop Consent — Banner Styles */

:root {
    --troop-consent-primary: #0055FF;
    --troop-consent-bg: #ffffff;
    --troop-consent-text: #333333;
    --troop-consent-border: #e5e5e5;
    --troop-consent-radius: 8px;
    --troop-consent-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
}

/* Base banner */
.troop-consent-banner {
    position: fixed;
    z-index: 999999;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--troop-consent-text);
    box-sizing: border-box;
}

.troop-consent-banner[hidden] {
    display: none !important;
}

.troop-consent-banner *,
.troop-consent-banner *::before,
.troop-consent-banner *::after {
    box-sizing: border-box;
}

/* Position: bottom bar */
.troop-consent-banner--bottom-bar {
    bottom: 0;
    left: 0;
    right: 0;
}

.troop-consent-banner--bottom-bar .troop-consent-banner__inner {
    background: var(--troop-consent-bg);
    box-shadow: var(--troop-consent-shadow);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    animation: troopConsentSlideUp 0.3s ease-out;
}

.troop-consent-banner--bottom-bar .troop-consent-banner__content {
    margin-bottom: 0;
}

.troop-consent-banner--bottom-bar .troop-consent-banner__aside {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Position: modal */
.troop-consent-banner--modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.troop-consent-banner__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: troopConsentFadeIn 0.2s ease-out;
}

.troop-consent-banner--modal .troop-consent-banner__inner {
    position: relative;
    z-index: 1;
    background: var(--troop-consent-bg);
    border-radius: var(--troop-consent-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 32px;
    max-width: 520px;
    width: 90%;
    animation: troopConsentScaleIn 0.3s ease-out;
}

/* Position: corner */
.troop-consent-banner--corner {
    bottom: 20px;
    left: 20px;
    max-width: 400px;
}

.troop-consent-banner--corner .troop-consent-banner__inner {
    background: var(--troop-consent-bg);
    border-radius: var(--troop-consent-radius);
    box-shadow: var(--troop-consent-shadow);
    padding: 24px;
    animation: troopConsentSlideUp 0.3s ease-out;
}

/* Content */
.troop-consent-banner__content {
    margin-bottom: 1rem;
}

.troop-consent-banner__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--troop-consent-text);
}

.troop-consent-banner__description {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* Buttons */
.troop-consent-banner__buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Privacy link */
.troop-consent-banner__privacy {
    margin-top: 0.75rem;
}

.troop-consent-banner__privacy-link {
    font-size: 13px;
    color: #888;
    text-decoration: underline;
    transition: color 0.2s;
}

.troop-consent-banner__privacy-link:hover {
    color: #555;
}

.troop-consent-banner__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--troop-consent-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
    white-space: nowrap;
    line-height: 1.2;
}

.troop-consent-banner__btn:hover {
    opacity: 0.9;
}

.troop-consent-banner__btn:focus-visible {
    outline: 2px solid var(--troop-consent-primary);
    outline-offset: 2px;
}

.troop-consent-banner__btn--accept {
    background: var(--troop-consent-primary);
    color: #fff;
}

.troop-consent-banner__btn--deny {
    background: var(--troop-consent-border);
    color: var(--troop-consent-text);
}

.troop-consent-banner__btn--settings {
    background: transparent;
    color: var(--troop-consent-primary);
    border: 1px solid var(--troop-consent-primary);
}

.troop-consent-banner__btn--save {
    background: var(--troop-consent-primary);
    color: #fff;
    width: 100%;
}

/* Settings modal */
.troop-consent-banner__modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: troopConsentFadeIn 0.2s ease-out;
}

.troop-consent-banner__modal[hidden] {
    display: none !important;
}

.troop-consent-banner__modal-inner {
    position: relative;
    background: var(--troop-consent-bg);
    border-radius: var(--troop-consent-radius);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: troopConsentScaleIn 0.3s ease-out;
}

.troop-consent-banner__modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.troop-consent-banner__modal-close:hover {
    color: var(--troop-consent-text);
}

.troop-consent-banner__modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
}

/* Category toggles */
.troop-consent-banner__category {
    padding: 16px 0;
    border-bottom: 1px solid var(--troop-consent-border);
}

.troop-consent-banner__category:last-of-type {
    border-bottom: none;
}

.troop-consent-banner__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.troop-consent-banner__toggle input[type="checkbox"] {
    position: relative;
    width: 44px;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.troop-consent-banner__toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.troop-consent-banner__toggle input[type="checkbox"]:checked {
    background: var(--troop-consent-primary);
}

.troop-consent-banner__toggle input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.troop-consent-banner__toggle input[type="checkbox"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.troop-consent-banner__toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--troop-consent-primary);
    outline-offset: 2px;
}

.troop-consent-banner__toggle-label {
    font-weight: 500;
    font-size: 15px;
}

.troop-consent-banner__category-desc {
    margin: 4px 0 0 56px;
    font-size: 13px;
    color: #666;
}

.troop-consent-banner__modal-buttons {
    margin-top: 20px;
}

/* ─── Cookie Declaration Page ─── */

.consent-declaration {
    width: 100%;
    font-family: inherit;
}

.consent-declaration__intro {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 2.5rem;
}

.consent-declaration__group {
    margin-bottom: 3rem;
}

.consent-declaration__group:last-of-type {
    margin-bottom: 2rem;
}

.consent-declaration__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.consent-declaration__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--troop-consent-text);
}

.consent-declaration__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.consent-declaration__badge--functional {
    background: #e8f5e9;
    color: #2e7d32;
}

.consent-declaration__badge--analytics {
    background: #e3f2fd;
    color: #1565c0;
}

.consent-declaration__badge--marketing {
    background: #fff3e0;
    color: #e65100;
}

.consent-declaration__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.consent-declaration__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    table-layout: fixed;
}

.consent-declaration__table th:nth-child(1),
.consent-declaration__table td:nth-child(1) { width: 20%; }

.consent-declaration__table th:nth-child(2),
.consent-declaration__table td:nth-child(2) { width: 18%; }

.consent-declaration__table th:nth-child(3),
.consent-declaration__table td:nth-child(3) { width: 44%; }

.consent-declaration__table th:nth-child(4),
.consent-declaration__table td:nth-child(4) { width: 18%; }

.consent-declaration__table th {
    padding: 0.625rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--troop-consent-text);
    border: none;
}

.consent-declaration__table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    color: #555;
}

.consent-declaration__table tbody tr {
    border-radius: 6px;
}

.consent-declaration__table tbody tr:nth-child(odd) {
    background: #f8f8fa;
}

.consent-declaration__cookie-name {
    font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    background: #f4f4f5;
    padding: 2px 8px;
    border-radius: 4px;
    color: #374151;
    white-space: nowrap;
}

.consent-declaration__expiry {
    color: #666;
    white-space: nowrap;
}

.consent-declaration__status {
    margin-top: 2rem;
}

.consent-declaration__status-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.375rem 0;
}

.consent-declaration__status-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--troop-consent-text);
    min-width: 180px;
}

.consent-declaration__status-value {
    font-size: 0.875rem;
    color: #555;
}

.consent-declaration__status-value code {
    font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    background: #f4f4f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.consent-declaration__status-none {
    font-size: 0.875rem;
    color: #888;
    font-style: italic;
    margin: 0;
}

.consent-declaration__actions {
    margin-top: 1.5rem;
}

.consent-declaration__revoke {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--troop-consent-primary);
    border: 1.5px solid var(--troop-consent-primary);
    border-radius: var(--troop-consent-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.consent-declaration__revoke:hover {
    background: var(--troop-consent-primary);
    color: #fff;
}

.consent-declaration__revoke:focus-visible {
    outline: 2px solid var(--troop-consent-primary);
    outline-offset: 2px;
}

/* Declaration responsive */
@media (max-width: 640px) {
    .consent-declaration__table th,
    .consent-declaration__table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .consent-declaration__header {
        flex-wrap: wrap;
    }
}

/* Animations */
@keyframes troopConsentSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes troopConsentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes troopConsentScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .troop-consent-banner--bottom-bar .troop-consent-banner__inner {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem;
    }

    .troop-consent-banner--bottom-bar .troop-consent-banner__aside {
        align-items: stretch;
    }

    .troop-consent-banner__buttons {
        flex-direction: column;
    }

    .troop-consent-banner__btn {
        width: 100%;
    }

    .troop-consent-banner__privacy {
        text-align: center;
    }

    .troop-consent-banner--corner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .troop-consent-banner__modal-inner {
        padding: 24px;
    }
}
