/**
 * MekryPro cookie consent banner and settings modal.
 * @author Kaido Mägi
 * @copyright 2026
 */

.mekry-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 1rem 1.25rem;
    background: #132a3b;
    border-top: 1px solid #334155;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.mekry-cookie-banner[hidden] {
    display: none !important;
}

.mekry-cookie-banner-content {
    flex: 1 1 16rem;
    min-width: 0;
}

.mekry-cookie-banner-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.mekry-cookie-banner-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #94a3b8;
}

.mekry-cookie-banner-text a {
    color: #6ee7b7;
    text-decoration: underline;
}

.mekry-cookie-banner-text a:hover {
    color: #a7f3d0;
}

.mekry-cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.mekry-cookie-banner-actions .mekry-btn {
    min-height: 2.25rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.mekry-cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(7, 11, 18, 0.72);
    box-sizing: border-box;
}

.mekry-cookie-modal-overlay.is-open {
    display: flex;
}

.mekry-cookie-modal {
    width: min(100%, 32rem);
    max-height: min(90vh, 40rem);
    overflow: auto;
    background: #182637;
    border: 1px solid #243447;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.mekry-cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.5rem;
}

.mekry-cookie-modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
}

.mekry-cookie-modal-close {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    width: 2rem;
    height: 2rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    outline: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mekry-cookie-modal-close-x {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 1.375rem;
    line-height: 1;
    font-weight: 400;
    color: inherit;
    pointer-events: none;
    transform: translateY(-1px);
}

.mekry-cookie-modal-close:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.mekry-cookie-modal-close:focus {
    outline: none;
    border-color: transparent;
}

.mekry-cookie-modal-close:focus-visible {
    outline: 2px solid #5fb4f5;
    outline-offset: 2px;
}

.mekry-cookie-modal-intro {
    margin: 0;
    padding: 0 1.25rem 0.75rem;
    color: #94a3b8;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.mekry-cookie-modal-body {
    padding: 0 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mekry-cookie-modal-card {
    border: 1px solid #243447;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.55);
}

.mekry-cookie-modal-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.mekry-cookie-modal-card-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #e2e8f0;
}

.mekry-cookie-modal-card-badge {
    font-size: 0.8125rem;
    color: #6ee7b7;
}

.mekry-cookie-modal-card-desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #94a3b8;
}

.mekry-cookie-modal-card .mekry-form-group-checkbox {
    margin: 0;
}

.mekry-cookie-modal .mekry-checkbox-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.mekry-cookie-modal .mekry-checkbox-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.mekry-cookie-modal .mekry-checkbox-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #64748b;
}

.mekry-cookie-modal .mekry-checkbox-svg .mekry-checkbox-check {
    opacity: 0;
    transition: opacity 0.15s;
}

.mekry-cookie-modal .mekry-checkbox-custom:checked + .mekry-checkbox-svg {
    color: #6ee7b7;
}

.mekry-cookie-modal .mekry-checkbox-custom:checked + .mekry-checkbox-svg .mekry-checkbox-check {
    opacity: 1;
}

.mekry-cookie-modal .mekry-checkbox-custom:focus-visible + .mekry-checkbox-svg {
    outline: 2px solid #5fb4f5;
    outline-offset: 2px;
    border-radius: 4px;
}

.mekry-cookie-modal-card .mekry-checkbox-label-wrap {
    align-items: flex-start;
}

.mekry-cookie-modal-footer {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    justify-content: flex-end;
}

.mekry-cookie-modal-footer .mekry-btn {
    min-width: 8rem;
}

.app-footer-legal .mekry-cookie-settings-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.app-footer-legal .mekry-cookie-settings-link:hover {
    color: #6ee7b7;
}

@media (max-width: 768px) {
    .mekry-cookie-banner {
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    }

    .mekry-cookie-banner-actions {
        width: 100%;
    }

    .mekry-cookie-banner-actions .mekry-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}
