/* RM Base – style bazowe elementów (nagłówki, linki, przyciski, formularze).
   Wyłączane w Dostosuj → Kształty i układ → „Style bazowe elementów”. */

/* ---------- Podstawy ---------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
	background-color: var(--rm-bg);
	color: var(--rm-text);
	font-family: var(--rm-font-body);
	font-size: var(--rm-font-size);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection { background: var(--rm-primary); color: var(--rm-on-primary); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--rm-font-heading);
	font-weight: var(--rm-heading-weight);
	color: var(--rm-text);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin-block: 0 .5em;
	text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 4rem); letter-spacing: -0.03em; line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 1.35rem + 1.9vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 1.15rem + .9vw, 1.75rem); }
h4 { font-size: 1.25rem; letter-spacing: -0.01em; }
h5 { font-size: 1.0625rem; letter-spacing: 0; }
h6 { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rm-text-muted); }

p { margin-block: 0 1.1em; text-wrap: pretty; }
small, .rm-muted { color: var(--rm-text-muted); }

a { color: var(--rm-primary); text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .2s var(--rm-ease); }
a:hover { color: var(--rm-primary-hover); }

img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--rm-border); margin-block: 2em; }

blockquote {
	margin: 1.5em 0;
	padding: .25em 0 .25em 1.25em;
	border-left: 3px solid var(--rm-primary);
	font-size: 1.125em;
	color: var(--rm-text);
}

code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--rm-surface); border: 1px solid var(--rm-border); border-radius: var(--rm-radius-sm); padding: .1em .4em; }
pre { background: var(--rm-surface); border-radius: var(--rm-radius); padding: 1.25em; overflow: auto; }

table { border-collapse: collapse; width: 100%; font-size: .95em; }
table td, table th { padding: .75em 1em; border: 0; border-bottom: 1px solid var(--rm-border); text-align: left; line-height: 1.5; }
table th { font-weight: 600; color: var(--rm-text); background: var(--rm-surface); }
table tbody > tr:nth-child(odd) > td, table tbody > tr:nth-child(odd) > th { background-color: transparent; }
table tbody tr:hover > td, table tbody tr:hover > th { background-color: var(--rm-surface); }

/* Fokus z klawiatury – dostępność (WCAG) */
:focus-visible { outline: 2px solid var(--rm-primary); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Link „Przejdź do treści” z Hello – widoczny tylko z klawiatury */
.skip-link.screen-reader-text:focus { background: var(--rm-text); color: var(--rm-bg); border-radius: var(--rm-radius-sm); font-weight: 600; }

/* ---------- Przyciski ---------- */
/* Hello Elementor ma domyślnie różowe (#c36) przyciski – podmieniamy na kolor marki,
   z tą samą szczegółowością, więc widgety Elementora dalej mają pierwszeństwo. */
[type="button"], [type="reset"], [type="submit"], button {
	border-color: var(--rm-primary);
	color: var(--rm-primary);
	border-radius: var(--rm-radius-btn);
}
[type="button"]:focus, [type="button"]:hover, [type="reset"]:focus, [type="reset"]:hover,
[type="submit"]:focus, [type="submit"]:hover, button:focus, button:hover {
	background-color: var(--rm-primary);
	color: var(--rm-on-primary);
}

/* Pełne przyciski: Elementor, Gutenberg, formularze (także zwykły <button type="submit"> bez klas) */
body .elementor-button,
.wp-block-button__link,
:where(form) button[type="submit"]:not([class]),
.wpcf7-submit,
.wpforms-form button[type="submit"],
.button, .woocommerce a.button, .woocommerce button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	font-family: var(--rm-font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	padding: .95em 1.6em;
	border: 1.5px solid var(--rm-primary);
	border-radius: var(--rm-radius-btn);
	background-color: var(--rm-primary);
	color: var(--rm-on-primary);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s var(--rm-ease), border-color .2s var(--rm-ease), color .2s var(--rm-ease), transform .2s var(--rm-ease), box-shadow .2s var(--rm-ease);
}
body .elementor-button:hover,
.wp-block-button__link:hover,
:where(form) button[type="submit"]:not([class]):hover,
.wpcf7-submit:hover,
.wpforms-form button[type="submit"]:hover,
.button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover {
	background-color: var(--rm-primary-hover);
	border-color: var(--rm-primary-hover);
	color: var(--rm-on-primary);
	transform: translateY(-1px);
	box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--rm-primary) 60%, transparent);
}
body .elementor-button:active { transform: translateY(0); box-shadow: none; }
body .elementor-button:focus-visible { outline: none; box-shadow: var(--rm-focus); }
body .elementor-button:disabled, .wpcf7-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.wp-block-button .wp-block-button__link, .wp-block-button .wp-block-button__link:hover { text-decoration: none; }

/* Warianty – dodaj klasę w Elementorze (Zaawansowane → Klasy CSS) */
body .rm-btn-outline .elementor-button, .rm-btn-outline.wp-block-button .wp-block-button__link, .is-style-outline .wp-block-button__link {
	background-color: transparent; color: var(--rm-primary);
}
body .rm-btn-outline .elementor-button:hover, .is-style-outline .wp-block-button__link:hover {
	background-color: var(--rm-primary); color: var(--rm-on-primary);
}
body .rm-btn-accent .elementor-button {
	background-color: var(--rm-accent); border-color: var(--rm-accent); color: var(--rm-on-accent);
}
body .rm-btn-accent .elementor-button:hover {
	background-color: var(--rm-accent-hover); border-color: var(--rm-accent-hover); color: var(--rm-on-accent);
	box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--rm-accent) 60%, transparent);
}
body .rm-btn-ghost .elementor-button {
	background-color: transparent; border-color: transparent; color: var(--rm-text); padding-inline: .25em;
}
body .rm-btn-ghost .elementor-button:hover { background: none; color: var(--rm-primary); box-shadow: none; transform: none; }
body .rm-btn-light .elementor-button {
	background-color: #fff; border-color: #fff; color: var(--rm-text);
}
body .rm-btn-light .elementor-button:hover { background-color: var(--rm-surface); border-color: var(--rm-surface); color: var(--rm-text); }

/* ---------- Formularze ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"],
input[type="password"], input[type="search"], input[type="date"], select, textarea,
body .elementor-field-group .elementor-field-textual,
body .elementor-field-group .elementor-select-wrapper select {
	width: 100%;
	font-family: var(--rm-font-body);
	font-size: 1rem;
	line-height: 1.4;
	color: var(--rm-text);
	background-color: var(--rm-bg);
	border: 1.5px solid var(--rm-border);
	border-radius: var(--rm-radius-sm);
	padding: .85em 1em;
	min-height: 52px;
	transition: border-color .2s var(--rm-ease), box-shadow .2s var(--rm-ease);
}
textarea, body .elementor-field-group textarea.elementor-field-textual { min-height: 140px; resize: vertical; }
input:hover, select:hover, textarea:hover,
body .elementor-field-group .elementor-field-textual:hover { border-color: color-mix(in srgb, var(--rm-text) 30%, var(--rm-border)); }
input:focus, select:focus, textarea:focus,
body .elementor-field-group .elementor-field-textual:focus {
	outline: none;
	border-color: var(--rm-primary);
	box-shadow: var(--rm-focus);
}
::placeholder { color: color-mix(in srgb, var(--rm-text-muted) 75%, transparent); opacity: 1; }

label, body .elementor-field-group > label, .wpforms-field-label {
	display: inline-block;
	font-weight: 600;
	font-size: .9375rem;
	color: var(--rm-text);
	margin-bottom: .4em;
}

input + label, select + label, textarea + label { margin-top: 1.1em; }
table thead th { border-top: 0; }

input[type="checkbox"], input[type="radio"] {
	accent-color: var(--rm-primary);
	width: 1.15em; height: 1.15em; min-height: 0; margin-right: .5em; vertical-align: -.15em;
}
body .elementor-field-type-acceptance label, body .elementor-field-subgroup label { font-weight: 400; font-size: .875rem; color: var(--rm-text-muted); }

/* Komunikaty formularzy */
body .elementor-message, .wpcf7 form .wpcf7-response-output {
	border-radius: var(--rm-radius-sm);
	padding: .9em 1.1em;
	margin: 1em 0 0;
	font-size: .9375rem;
}
body .elementor-message.elementor-message-success, .wpcf7 form.sent .wpcf7-response-output {
	background: color-mix(in srgb, #16A34A 10%, var(--rm-bg)); color: #166534; border: 1px solid color-mix(in srgb, #16A34A 30%, transparent);
}
body .elementor-message.elementor-message-danger, .wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output {
	background: color-mix(in srgb, #DC2626 8%, var(--rm-bg)); color: #991B1B; border: 1px solid color-mix(in srgb, #DC2626 30%, transparent);
}
body .elementor-message::before { display: none; }
.wpcf7-not-valid-tip, body .elementor-error .elementor-field-textual + .elementor-message { font-size: .8125rem; color: #B91C1C; margin-top: .35em; }
body .elementor-error .elementor-field-textual, .wpcf7-not-valid { border-color: #DC2626 !important; }

/* ---------- Drobiazgi Elementora ---------- */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.elementor-icon-list-items .elementor-icon-list-icon i, .elementor-icon-list-items .elementor-icon-list-icon svg { color: var(--rm-primary); fill: var(--rm-primary); }
.e-con { --container-max-width: var(--rm-container); }

/* Powiadomienia cookies / dialogi – zaokrąglenia zgodne z marką */
.dialog-message, .elementor-popup-modal .dialog-widget-content { border-radius: var(--rm-radius-lg); }
