/* Shared PL/EN newsletter box for standalone pawel.life tools. */
.tool-subscribe {
    width: min(640px, 100%);
    margin: 1.5rem auto;
    padding: 1.5rem;
    border: 1.5px solid var(--border-strong, rgba(0, 0, 0, 0.15));
    border-radius: 16px;
    background: var(--bg-secondary, #f5f5f7);
    color: var(--text, #1d1d1f);
    font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    text-align: center;
}

.tool-subscribe,
.tool-subscribe * {
    box-sizing: border-box;
}

/* Widget mierzy WLASNA szerokosc (container query). Stary breakpoint 680px
   patrzyl na viewport, wiec w waskiej karcie na szerokim ekranie (/tools:
   kontener 560px przy oknie 1456px) pola schodzily do ~81px i placeholdery
   sie ucinaly (Chrome, feedback Pawla 2026-08-08). */
.tool-subscribe {
    container-type: inline-size;
}

@container (max-width: 600px) {
    .tool-subscribe__fields {
        grid-template-columns: 1fr !important;
    }
    .tool-subscribe__button {
        width: 100%;
    }
}

.tool-subscribe__heading {
    margin: 0 0 0.35rem;
    color: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.tool-subscribe__copy,
.tool-subscribe__note {
    margin: 0;
    color: var(--text-secondary, #515154);
    line-height: 1.5;
}

.tool-subscribe__copy {
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.tool-subscribe__note {
    margin-top: 0.7rem;
    font-size: 0.72rem;
}

.tool-subscribe__fields {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
    gap: 0.55rem;
}

.tool-subscribe__input,
.tool-subscribe__button {
    min-height: 44px;
    border-radius: 999px;
    font: inherit;
}

.tool-subscribe__input {
    min-width: 0;
    padding: 0 1rem;
    border: 1.5px solid var(--border-strong, rgba(0, 0, 0, 0.15));
    background: var(--bg, #fff);
    color: inherit;
    outline: none;
}

.tool-subscribe__input:focus {
    border-color: #d4a012;
    box-shadow: 0 0 0 3px rgba(212, 160, 18, 0.15);
}

.tool-subscribe__button {
    border: 0;
    padding: 0 1.2rem;
    background: linear-gradient(135deg, #d4a012 0%, #c2410c 55%, #b91c1c 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.tool-subscribe__button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.tool-subscribe__status {
    display: none;
    margin: 0.8rem 0 0;
    padding: 0.6rem 0.8rem;
    border-radius: 9px;
    font-size: 0.8rem;
}

.tool-subscribe__status.success {
    display: block;
    background: rgba(16, 191, 122, 0.12);
    color: #0c7c51;
}

.tool-subscribe__status.error {
    display: block;
    background: rgba(242, 100, 59, 0.12);
    color: #c9340a;
}

/* Dark = tokeny site'u (main.css), nie osobna paleta. Fioletowe #120e24/#1b1633
   wygladalo jak obcy, retro wtret na tle reszty strony (feedback Pawla
   2026-08-07). Fallbacki dzialaja tez na standalone stronach bez main.css. */
[data-theme="dark"] .tool-subscribe {
    --bg: #111111;
    --bg-secondary: #1a1a1a;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --border-strong: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .tool-subscribe__status.success {
    color: #7fffb3;
}

[data-theme="dark"] .tool-subscribe__status.error {
    color: #ff9cad;
}

@media (max-width: 680px) {
    .tool-subscribe {
        padding: 1.2rem 1rem;
    }

    .tool-subscribe__fields {
        grid-template-columns: 1fr;
    }

    .tool-subscribe__button {
        width: 100%;
    }
}

/* Standalone game pages do not load main.css, so keep consent usable there. */
.standalone-tool-page #cookieConsent {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    width: min(520px, calc(100vw - 32px));
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    background: var(--bg, #fff);
    color: var(--text, #1d1d1f);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.standalone-tool-page #cookieConsent.cc-visible {
    opacity: 1;
    transform: translateY(0);
}

.standalone-tool-page #cookieConsent .cc-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.standalone-tool-page #cookieConsent .cc-text {
    flex: 1;
    margin: 0;
    color: var(--text-secondary, #515154);
    font-size: 0.78rem;
    line-height: 1.45;
}

.standalone-tool-page #cookieConsent .cc-link {
    color: #b77900;
    text-decoration: underline;
}

.standalone-tool-page #cookieConsent .cc-actions {
    display: flex;
    gap: 0.45rem;
}

.standalone-tool-page #cookieConsent .cc-btn {
    min-height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    padding: 0 0.9rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.standalone-tool-page #cookieConsent .cc-btn-accept {
    border: 0;
    background: linear-gradient(135deg, #d4a012, #b91c1c);
    color: #fff;
}

@media (max-width: 680px) {
    .standalone-tool-page #cookieConsent .cc-inner,
    .standalone-tool-page #cookieConsent .cc-actions {
        flex-direction: column;
    }

    .standalone-tool-page #cookieConsent .cc-actions,
    .standalone-tool-page #cookieConsent .cc-btn {
        width: 100%;
    }
}
