/* === CSS RESET & NORMALIZE === */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline;
  box-sizing: border-box;
}
html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
article, aside, details, figcaption, figure, 
footer, header, hgroup, main, menu, nav, section {
  display: block;
}
body {
  background: #F8FAFB;
  color: #183153;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}
ul, ol {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}
button, input, select, textarea {
  font: inherit;
  outline: none;
  background: none;
  border: none;
  box-sizing: border-box;
}
[tabindex]:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid #183153;
  outline-offset: 2px;
}

/* === CUSTOM PROPERTIES (with fallback for wide support) === */
:root {
  --color-primary: #183153;
  --color-secondary: #E3EFFF;
  --color-accent: #FBE58A;
  --color-bg: #F8FAFB;
  --color-white: #fff;
  --color-gray: #E6ECEF;
  --color-placeholder: #B5C4D4;
  --font-display: 'Montserrat', Arial, sans-serif;
  --font-body: 'Roboto', Arial, sans-serif;
  --shadow-small: 0 2px 8px 0 rgba(24,49,83,0.05);
  --shadow-card: 0 4px 24px 0 rgba(24, 49, 83, 0.12);
  --border-radius: 14px;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display, 'Montserrat', Arial, sans-serif);
  color: var(--color-primary, #183153);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
h1 { font-size: 2.4rem; margin-bottom: 24px; }
h2 { font-size: 2rem;  margin-bottom: 18px; }
h3 { font-size: 1.25rem; margin-bottom: 12px; }
h4 { font-size: 1.125rem; margin-bottom: 10px; }
h5, h6 { font-size: 1rem; }
p, ul, ol, li {
  color: var(--color-primary, #183153);
  font-family: var(--font-body, 'Roboto', Arial, sans-serif);
  font-size: 1rem;
  margin-bottom: 14px;
}
b, strong { font-weight: 600; }
.text-section h2, .text-section h3 {margin-top: 32px;}

@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
}

/* === LAYOUT HELPERS === */
.container {
  width: 100%;
  max-width: 1176px;
  margin: 0 auto;
  padding: 0 16px;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* === SECTION SPACING: Per requirements === */
section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: transparent;
}

@media (max-width: 768px) {
  section {
    padding: 28px 0 28px 0;
  }
}

/* === HEADER & NAVIGATION === */
header {
  background: var(--color-white, #fff);
  box-shadow: var(--shadow-small);
  border-bottom: 1px solid var(--color-gray);
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 100;
}
header .container {
  padding-top: 12px; padding-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header img[alt='FinEkspert'] {
  height: 36px; width: auto;
  margin-right: 24px;
  display: block;
}
header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
header nav a {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-primary);
  padding: 7px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
header nav a.cta {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 20px;
  font-weight: 600;
  padding: 8px 24px;
  box-shadow: 0 2px 12px rgba(24,49,83,0.05);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
header nav a.cta:hover,
header nav a.cta:focus {
  background: var(--color-accent);
  color: var(--color-primary);
  transform: translateY(-2px) scale(1.035);
}
header nav a:hover,
header nav a:focus:not(.cta) {
  background: var(--color-secondary);
  color: var(--color-primary);
}
.mobile-menu-toggle {
  display: none;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 6px;
  font-size: 1.8rem;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 16px;
  border: none;
  transition: background 0.15s;
}
.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  background: var(--color-accent);
  color: var(--color-primary);
}

@media (max-width: 992px) {
  header nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
}

/* === MOBILE MENU === */
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: 100vw;
  z-index: 9999;
  background: rgba(24, 49, 83, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.mobile-menu.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu nav.mobile-nav {
  background: var(--color-white);
  min-width: 72vw;
  max-width: 95vw;
  height: 100%;
  padding: 36px 24px 28px 24px;
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: flex-start;
  align-items: flex-start;
}
.mobile-menu-close {
  background: var(--color-secondary);
  color: var(--color-primary);
  border-radius: 50%;
  width: 36px; height: 36px;
  border: none;
  position: absolute;
  top: 16px; right: 5vw;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  transition: background 0.15s, color 0.18s;
}
.mobile-menu-close:hover,
.mobile-menu-close:focus {
  background: var(--color-accent);
  color: var(--color-primary);
}
.mobile-nav a {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.18rem;
  padding: 12px 0;
  border-radius: 8px;
  width: 100%;
  display: block;
  transition: background 0.17s, color 0.17s;
}
.mobile-nav a.cta {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 18px;
  font-weight: 600;
  padding-left: 22px; padding-right:22px;
  margin-top: 12px;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--color-secondary);
  color: var(--color-primary);
}
.mobile-nav a.cta:hover, .mobile-nav a.cta:focus {
  background: var(--color-accent);
  color: var(--color-primary);
}

@media (min-width: 993px) {
  .mobile-menu { display: none !important; }
  .mobile-menu-toggle { display: none !important; }
}

/* === HERO SECTIONS === */
section:first-of-type {
  padding-top: 60px;
  padding-bottom: 48px;
  background: var(--color-secondary, #E3EFFF);
  border-bottom: 1px solid var(--color-gray);
}
@media (max-width: 768px) {
  section:first-of-type { padding-top: 38px; padding-bottom:30px; }
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* === FLEXBOX PATTERNS & ULs === */
ul, ol {
  margin: 12px 0 18px 0;
  padding: 0 0 0 0;
}
ul li, ol li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
ul li:last-child, ol li:last-child {
  margin-bottom: 0;
}

/* === BUTTONS / CTA === */
.cta, button, input[type="submit"] {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 12px 32px;
  box-shadow: 0 2px 12px rgba(24,49,83,0.07);
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, transform 0.16s;
  margin-right: 10px;
  margin-bottom: 6px;
  min-width: 130px;
  text-align: center;
  outline: none;
}
.cta:hover, .cta:focus,
button:hover, button:focus,
input[type="submit"]:hover, input[type="submit"]:focus {
  background: var(--color-accent);
  color: var(--color-primary);
  transform: translateY(-2px) scale(1.03);
}
button[disabled], input[disabled], .cta[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Accent (yellow) style for selected buttons */
.button-accent {
  background: var(--color-accent);
  color: var(--color-primary);
}
.button-accent:hover,
.button-accent:focus {
  background: var(--color-primary);
  color: var(--color-white);
}

/* === FEATURES, CARDS, GRIDS === */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  padding: 32px 24px;
  position: relative;
  transition: box-shadow 0.18s, transform 0.18s;
  min-width: 220px;
}
.card:hover, .card:focus {
  box-shadow: 0 8px 32px rgba(24,49,83,0.17);
  transform: translateY(-2px) scale(1.01);
}

.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
@media (max-width: 768px){
  .text-image-section {
    flex-direction: column;
    gap: 24px;
  }
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 12px rgba(24,49,83,0.10);
  padding: 20px;
  margin-bottom: 20px;
  max-width: 540px;
  min-width: 260px;
  margin-left: auto; margin-right: auto;
  transition: box-shadow 0.15s, transform 0.15s;
}
.testimonial-card:hover {
  box-shadow: 0 8px 32px rgba(24,49,83,0.13);
  transform: translateY(-3px) scale(1.01);
}
.testimonial-card p {
  margin-bottom: 0;
  color: var(--color-primary);
  text-align: center;
}
.testimonial-card strong {
  color: var(--color-primary);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  background: var(--color-secondary);
  padding: 18px 18px 18px 18px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  min-width: 180px;
  box-shadow: 0 1px 6px rgba(24,49,83,0.05);
}

/* === FORMS, INPUTS, SEARCH & NEWSLETTER === */
input, textarea, select {
  border: 1px solid #B5C4D4;
  border-radius: 8px;
  padding: 10px 16px;
  margin-right: 8px;
  margin-bottom: 10px;
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-primary);
  width: 100%;
  max-width: 390px;
  box-shadow: none;
  transition: border 0.18s;
}
input:focus, textarea:focus, select:focus {
  border: 1.5px solid var(--color-primary);
  background: #F8FAFB;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder {
  color: var(--color-placeholder);
  font-family: var(--font-body);
  opacity: 1;
}
form,
.newsletter-cta,
.content-wrapper > div > input,
.content-wrapper > div > button {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* === FOOTER === */
footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding-top: 44px;
  padding-bottom: 24px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}
footer .container {
  padding: 0 16px;
}
footer .content-wrapper {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
footer a, footer p, footer strong {
  color: var(--color-white);
}
footer nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 150px;
}
footer .contact-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  font-size: 0.98rem;
}
footer .social-links {
  display: flex;
  gap: 18px;
  align-items: center;
}
footer .social-links a img {
  width: 27px; height: 27px;
  filter: grayscale(0.4) brightness(1.1);
  transition: filter 0.11s, transform 0.14s;
}
footer .social-links a:hover img {
  filter: none;
  transform: scale(1.11);
}
footer img[alt='FinEkspert'] {
  max-height: 36px;
  margin-bottom: 14px;
}
@media (max-width: 800px) {
  footer .content-wrapper {
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
  }
}

/* === TABLES (PRIVACY, GDPR, ETC.) === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 18px 0;
  font-size: 1rem;
}
thead th {
  background: var(--color-gray);
  font-weight: 600;
  padding: 8px 10px;
}
tbody td {
  background: var(--color-white);
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-gray);
}

/* === COOKIE BANNER & MODAL === */
.cookie-banner {
  position: fixed;
  z-index: 99999;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: 0 -3px 16px rgba(24,49,83,0.11);
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px 16px 18px 16px;
  font-size: 1rem;
  transition: transform 0.3s, opacity 0.3s;
}
.cookie-banner.hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}
.cookie-banner .cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cookie-banner button {
  padding: 8px 24px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  background: var(--color-secondary);
  color: var(--color-primary);
  transition: background 0.14s, color 0.17s, transform 0.13s;
  margin: 0;
}
.cookie-banner button.accept {
  background: var(--color-primary);
  color: var(--color-white);
}
.cookie-banner button.accept:hover,
.cookie-banner button.accept:focus {
  background: var(--color-accent);
  color: var(--color-primary);
}
.cookie-banner button.reject {
  background: #FFF5F5;
  color: #E22B2B;
}
.cookie-banner button.reject:hover,
.cookie-banner button.reject:focus {
  background: #FFCECC;
  color: #A81414;
}
.cookie-banner button.settings {
  background: var(--color-secondary);
}
.cookie-banner button.settings:hover,
.cookie-banner button.settings:focus {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* === COOKIE SETTINGS MODAL === */
.cookie-modal {
  position: fixed;
  z-index: 100000;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(24,49,83,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.28s;
}
.cookie-modal.open {
  opacity: 1; pointer-events: all;
}
.cookie-modal .modal-content {
  background: var(--color-white);
  border-radius: 18px;
  padding: 32px 22px;
  width: 96vw;
  max-width: 460px;
  box-shadow: 0 8px 40px rgba(24,49,83,0.13);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: modal-in 0.31s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modal-in {
  0% { transform: translateY(25px) scale(0.98); opacity:0; }
  100% { transform: translateY(0) scale(1); opacity:1; }
}
.cookie-modal .close-modal {
  background: var(--color-secondary);
  color: var(--color-primary);
  border-radius: 50%;
  width: 34px; height: 34px;
  border: none;
  align-self: flex-end;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background 0.14s, color 0.16s;
}
.cookie-modal .close-modal:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}
.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}
.cookie-category label {
  font-size:1rem;
  font-family: var(--font-body);
  color: var(--color-primary);
}
/* Custom toggle styles */
.cookie-toggle {
  width: 38px; height: 22px;
  display: inline-block;
  position: relative;
}
.cookie-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0; height: 0;
}
.cookie-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-gray);
  border-radius: 11px;
  transition: background 0.2s;
}
.cookie-toggle input:checked + .slider {
  background: var(--color-accent);
}
.cookie-toggle .slider:before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 2px; bottom: 2px;
  background: var(--color-primary);
  border-radius: 50%;
  transition: transform 0.18s, background 0.2s;
}
.cookie-toggle input:checked + .slider:before {
  transform: translateX(16px);
  background: #1061c5;
}
.cookie-category.essential label {
  font-weight: 600;
  color: var(--color-primary);
}
.cookie-category.essential .cookie-toggle {
  pointer-events: none;
  opacity: 0.65;
}

/* === BLOG, ARTICLES, CATEGORIES === */
article {
  background: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  padding: 20px 18px;
  margin-bottom: 20px;
  transition: box-shadow 0.16s, transform 0.16s;
}
article:hover {
  box-shadow: 0 8px 32px rgba(24,49,83,0.13);
  transform: translateY(-2px) scale(1.02);
}
article h3 { margin-bottom: 12px; }
article p { margin-bottom: 10px; }
article a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.16s;
}
article a:hover,
article a:focus {
  color: var(--color-accent);
}

/* Blog search/cat btns */
.content-wrapper > div > input[type="text"] {
  max-width: 240px;
  margin-right: 7px;
}
.content-wrapper > div > button {
  font-size: 1rem;
  border-radius: 18px;
  padding: 9px 20px;
  background: var(--color-secondary);
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 6px;
}
.content-wrapper > div > button:hover,
.content-wrapper > div > button:focus {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* Newsletter CTA */
.newsletter-cta {
  display: flex;
  gap:14px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 480px){
  .newsletter-cta { flex-direction: column; gap: 8px; }
}

/* === TABLES (POLICIES) === */
table, th, td {
  border: none;
}
thead th {
  background: var(--color-gray);
}

/* === GENERAL RESPONSIVE RULES === */
@media (max-width: 700px) {
  .container {
    padding: 0 5vw;
    max-width: 100vw;
  }
  section {padding-left:8px;padding-right:8px;}
}
@media (max-width: 540px) {
  h1 { font-size: 1.15rem; }
  h2 { font-size: 1rem; }
  section {padding-left:4px;padding-right:4px;}
}
/* Footer align mobile */
@media (max-width: 600px) {
  footer .content-wrapper {flex-direction:column;gap:10px;}
}

/* === FAQ (kontakt) === */
.content-wrapper > ul > li > h3 {
  margin-top: 10px;
  margin-bottom: 3px;
  font-size: 1.1rem;
}
/* --- Accessibility: focus ring for all interactive elements --- */
.cta:focus, a:focus, button:focus, input:focus, .mobile-menu-close:focus {
  outline: 2px solid var(--color-accent) !important;
  outline-offset: 2px;
}

/* === MICRO-INTERACTIONS === */
a, button, .cta, input[type="submit"] {
  transition: background 0.13s, color 0.14s, transform 0.13s, box-shadow 0.13s;
}

/* === IMAGE ICONS in lists === */
ul li img, .contact-details img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* === Misc. Spacing Adjustments === */
.section {  margin-bottom: 60px; padding: 40px 20px;}
.card-container {display: flex; flex-wrap: wrap; gap: 24px;}
.card {margin-bottom: 20px; position: relative; }
.content-grid {display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between;}
.text-image-section {display: flex; align-items: center; gap: 30px; flex-wrap: wrap;}
.testimonial-card {display: flex; align-items: center; gap: 20px; padding: 20px;}
.feature-item {display: flex; flex-direction: column; align-items: flex-start; gap: 15px;}

/* === MINIMUM CARD MARGIN & GAP ENSURED === */
.card, .testimonial-card, .feature-item, article {
  margin-bottom: 20px;
}

/* === Z-INDEX LAYERING (Header/Mobile/Cookie) === */
header { z-index: 100; }
.mobile-menu { z-index: 9999; }
.cookie-banner { z-index: 99999; }

/* === OVERLAY/FOCUS PREVENTIONS === */
.card, .testimonial-card {
  position: relative;
  z-index: 1;
}
/* (NO absolute positioning for cards/text blocks per requirements) */

/* --- SCANDINAVIAN CLEAN MOOD --- */
body, section, .card, .testimonial-card, .feature-item, article, .content-wrapper {
  background: none;
}
section {
  /* Subtle separation by light backgrounds */
}
.content-wrapper, .card-container, .content-grid {
  background: none;
}
/* White space rules */
main { min-height: 50vh; }

/* --- END --- */
