/* CSS RESET & BASE STYLES - Playful Dynamic Theme for Python Masterclass Italia */

/* RESET */
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-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
html {
  height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  min-height: 100%;
  font-family: 'Open Sans', Arial, sans-serif;
  background: #f4f6fa;
  color: #23456e;
  line-height: 1.6;
  position: relative;
}
img, picture, video, canvas, svg {
  display: inline-block;
  max-width: 100%;
  height: auto;
}
a {
  color: #1ecba8;
  text-decoration: none;
  outline: none;
  transition: color 0.2s;
}
a:hover, a:focus {
  color: #ffae34;
}
ul, ol {
  padding-left: 1.25em;
}

/* BRAND COLORS AND VARIABLES */
:root {
  --color-primary: #23456e;
  --color-secondary: #1ecba8;
  --color-accent: #f4f6fa;
  --color-accent2: #ffae34;
  --color-error: #ed254e;
  --color-white: #fff;
  --color-black: #181826;
  --shadow: 0 2px 12px 0 rgba(35,69,110,0.13);
}

/* FONT-FACE: Google Fonts as Fallbacks */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:700,800&family=Open+Sans:400,600,700&display=swap');

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
  color: var(--color-primary);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 0.75em; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4, h5, h6 { font-size: 1rem; font-weight: 700; }
p, li { font-size: 1rem; }

/* LAYOUT STRUCTURE (only flexbox, NO grid) */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* HEADER + NAVIGATION */
header {
  background: var(--color-primary);
  color: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 101;
}
header .content-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}
header nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
header nav a {
  color: var(--color-white);
  font-family: 'Montserrat', monospace, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  position: relative;
}
header nav a:hover, header nav a:focus {
  background: var(--color-secondary);
  color: var(--color-primary);
}
header img {
  max-height: 44px;
  margin-right: 16px;
}

.btn {
  display: inline-block;
  font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
  font-weight: 700;
  border-radius: 24px;
  padding: 12px 32px;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  margin: 10px 0 0 0;
  box-shadow: 0 3px 14px rgba(35,69,110,0.13);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  outline: none;
}
.btn-primary {
  background: var(--color-secondary);
  color: var(--color-primary);
  border: 2px solid var(--color-secondary);
}
.btn-primary:hover, .btn-primary:focus {
  background: #24e3be;
  transform: translateY(-2px) scale(1.04);
  color: var(--color-primary);
}
.btn-secondary {
  background: var(--color-accent2);
  color: var(--color-white);
  border: 2px solid var(--color-accent2);
  margin-left: 16px;
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--color-primary);
  color: var(--color-accent2);
  border-color: var(--color-primary);
}
.read-more {
  color: var(--color-secondary);
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.2s;
}
.read-more:hover, .read-more:focus {
  color: var(--color-accent2);
}

/* FLEXBOX: MAIN LAYOUTS (Mandatory Spacing Patterns) */
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: var(--color-accent);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: var(--color-white);
  box-shadow: var(--shadow);
  border-radius: 18px;
  margin-bottom: 20px;
  position: relative;
  padding: 28px 22px 22px 22px;
  min-width: 260px;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.23s, transform 0.21s;
}
.card:hover, .card:focus-within {
  box-shadow: 0 6px 28px 0 rgba(30,203,168,0.14);
  transform: translateY(-3px) scale(1.022);
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
}
.testimonial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 20px;
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 3px 16px rgba(35,69,110,0.08);
  flex-direction: row;
  min-width: 240px;
  max-width: 720px;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.testimonial-card p {
  color: var(--color-black);
  font-size: 1.1rem;
  font-style: italic;
}
.testimonial-card span {
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 700;
}
.testimonial-card:hover, .testimonial-card:focus-within {
  box-shadow: 0 8px 36px 0 rgba(30,203,168,0.11);
  transform: scale(1.025);
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

/* --- Feature Grid, playful cards --- */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.feature-grid > div {
  background: var(--color-white);
  border-radius: 18px;
  box-shadow: 0 1px 8px 0 rgba(30,203,168,0.10);
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 330px;
  padding: 26px 22px 20px 22px;
  transition: box-shadow 0.2s, transform 0.18s;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  position: relative;
}
.feature-grid > div:hover {
  box-shadow: 0 6px 23px 0 rgba(35,69,110,0.18);
  transform: scale(1.04) translateY(-5px) rotate(-1deg);
}
.feature-grid img {
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
  background: var(--color-secondary);
  padding: 8px;
  border-radius: 50%;
  box-shadow: 0 2px 10px 0 rgba(30,203,168,0.07);
}

/* CTA Block */
.cta-block {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 24px;
}

/* Footer */
footer {
  background: var(--color-primary);
  color: var(--color-accent);
  padding: 40px 0 24px 0;
  margin-top: 24px;
}
footer .content-wrapper {
  flex-direction: row;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
footer .text-section img {
  max-height: 36px;
  margin-bottom: 12px;
}
footer nav, .footer-links, .social-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin: 6px 0;
}
footer nav a, .footer-links a {
  color: var(--color-accent);
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Montserrat', Arial, sans-serif;
  transition: color 0.2s;
}
footer nav a:hover, .footer-links a:hover {
  color: var(--color-secondary);
}
.social-links a img {
  width: 26px; height: 26px; filter: brightness(1.4);
  transition: filter 0.2s, transform 0.17s;
}
.social-links a:hover img {
  filter: brightness(2.2) drop-shadow(0 2px 0 var(--color-secondary));
  transform: scale(1.15);
}

/* Text Section & Utility Flex */
.text-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

/* Success, Error, Info styles (Alerts) */
.alert {
  border-radius: 8px;
  padding: 15px 18px;
  font-size: 1rem;
  margin: 20px 0;
  background: #fffbe7;
  color: #d08801;
  border-left: 5px solid #ffae34;
}
.alert-success {
  background: #f0fff2;
  color: #1ecba8;
  border-left-color: #1ecba8;
}
.alert-error {
  background: #fff2f5;
  color: #ed254e;
  border-left-color: #ed254e;
}

/* Animations & Microinteractions */
@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.93); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes slide-up-fade {
  0% { opacity:0; transform: translateY(22px); }
  100% { opacity: 1; transform: none; }
}
@keyframes slide-in-right {
  0% { transform: translateX(110%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes slide-in-bottom {
  0% { transform: translateY(100%); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.section, .card, .feature-grid > div, .testimonial-card, .btn {
  animation: pop-in 0.7s cubic-bezier(.7,-0.2,.26,1.2) backwards;
}

/* --- Hamburger Mobile Nav Styles --- */
.mobile-menu-toggle {
  position: fixed;
  right: 22px;
  top: 19px;
  z-index: 130;
  background: var(--color-secondary);
  color: var(--color-primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  border: none;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px 0 rgba(30,203,168,0.13);
  transition: background 0.2s, box-shadow 0.18s, transform 0.11s;
  cursor: pointer;
}
.mobile-menu-toggle:hover, .mobile-menu-toggle:focus {
  background: #24e3be;
  box-shadow: 0 0 0 3px var(--color-secondary);
  transform: scale(1.06);
}

.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-white);
  box-shadow: 0 8px 48px 0 rgba(35,69,110,0.20), 0 0px 0 9999px rgba(24,24,38,0.12);
  z-index: 200;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(.44,0,.12,1.22), opacity 0.2s;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  animation: slide-in-right 0.36s both;
}
.mobile-menu-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-primary);
  align-self: flex-end;
  margin: 26px 24px 6px 0;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s, transform 0.12s;
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  color: var(--color-error);
  transform: scale(1.08) rotate(3deg);
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 2em;
  padding: 0 44px;
}
.mobile-nav a {
  color: var(--color-primary);
  font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 16px 0 8px 0;
  border-bottom: 2px solid #e6ecee;
  transition: color 0.2s, border-color 0.19s, background 0.16s;
  border-radius: 8px;
  min-height: 32px;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  color: var(--color-secondary);
  border-color: var(--color-secondary);
  background: #f9fffa;
}

/* Hide desktop nav/burger responsibly */
@media (max-width: 1020px) {
  header nav,
  header .btn-primary {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
}
@media (min-width:1021px) {
  .mobile-menu, .mobile-menu-toggle {
    display: none !important;
  }
  header nav,
  header .btn-primary {
    display: flex;
  }
}

/* Responsive Section Pattern: Column on Narrow */
@media (max-width: 768px) {
  .content-wrapper,
  .text-section,
  .footer .content-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 18px;
  }
  .feature-grid, .card-container, .content-grid, .cta-block {
    flex-direction: column !important;
    align-items: stretch;
    gap: 18px;
  }
  .section {
    padding: 28px 8px;
    border-radius: 12px;
  }
  .text-image-section { flex-direction: column; gap: 18px; }
  .testimonial-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 500px) {
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }
  .container { padding: 0 8px; }
  .section { padding: 16px 2px; border-radius: 8px; }
  .btn, .btn-primary, .btn-secondary { width: 100%; min-width: 0; margin-left: 0; }
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  left: 0; right:0; bottom: 0;
  z-index: 260;
  background: var(--color-primary);
  color: var(--color-accent);
  box-shadow: 0 -2px 18px 0 rgba(35,69,110,0.13);
  width: 100vw;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  animation: slide-in-bottom 0.55s cubic-bezier(.65,-0.10,.40,1.13);
}
.cookie-banner p {
  flex: 1 1 0;
  font-size: 1rem;
  color: var(--color-accent);
}
.cookie-banner .cookie-actions {
  display: flex;
  flex-direction: row;
  gap: 14px;
}
.cookie-banner .btn {
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 24px;
  box-shadow: none;
}
.cookie-banner .btn-cookie-settings {
  background: var(--color-accent2);
  color: var(--color-primary);
  border: 2px solid var(--color-accent2);
}
.cookie-banner .btn-cookie-settings:hover, .cookie-banner .btn-cookie-settings:focus {
  background: var(--color-secondary);
  color: var(--color-primary);
  border-color: var(--color-secondary);
}

.cookie-banner .btn-cookie-reject {
  background: #dcefeb;
  color: var(--color-primary);
  border: 2px solid #bde1d6;
}
.cookie-banner .btn-cookie-reject:hover, .cookie-banner .btn-cookie-reject:focus {
  background: var(--color-error);
  color: var(--color-accent);
  border-color: var(--color-error);
}

@media (max-width: 700px) {
  .cookie-banner { flex-direction: column; align-items: flex-start; gap: 16px; padding: 16px 8px; }
  .cookie-banner .cookie-actions { flex-wrap: wrap; gap: 10px; }
}

/* Cookie Consent Modal */
.cookie-modal-backdrop {
  position: fixed;
  left:0; top:0;
  width: 100vw; height: 100vh;
  background: rgba(35,69,110,0.39);
  z-index: 320;
  opacity: 1;
  animation: fadeIn 0.3s;
  pointer-events: auto;
}
.cookie-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(1);
  min-width: 280px;
  max-width: 95vw;
  width: 440px;
  background: var(--color-white);
  color: var(--color-primary);
  border-radius: 20px;
  box-shadow: 0 6px 62px 0 rgba(24,24,38,0.18);
  padding: 36px 28px 28px 28px;
  z-index: 340;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: pop-in 0.4s cubic-bezier(.8,1.4,.29,1.01);
}
.cookie-modal h3 { font-size: 1.32rem; font-weight: 800; }
.cookie-modal .cookie-category {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.cookie-modal label {
  font-size: 1rem;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  color: var(--color-primary);
}
.cookie-modal .switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  margin-right: 8px;
}
.cookie-modal .switch input {
  opacity: 0; width: 0; height: 0;
}
.cookie-modal .slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #e6ecee;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.cookie-modal .switch input:checked + .slider { background: var(--color-secondary); }
.cookie-modal .slider:before {
  content: "";
  position: absolute;
  left: 4px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-white);
  transition: transform 0.2s;
  box-shadow: 0 2px 8px 0 rgba(35,69,110,0.07);
}
.cookie-modal .switch input:checked + .slider:before {
  transform: translateX(18px);
}
.cookie-modal .cookie-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cookie-modal .btn {
  font-size: 1.05rem;
  padding: 8px 20px;
}
.cookie-modal .btn-primary {
  background: var(--color-secondary);
  color: var(--color-primary);
}
.cookie-modal .btn-cookie-reject {
  background: #dcefeb;
  color: var(--color-primary);
}
.cookie-modal .btn-cookie-settings {
  background: var(--color-accent2);
  color: var(--color-primary);
}
@media (max-width: 480px) {
  .cookie-modal { width: 99vw; padding: 22px 6px 12px 6px; }
  .cookie-modal h3 { font-size: 1.03rem; }
}

/* Playful/Dynamic Touches: Color spots and Decorations (decorative absolute only) */
.section:before {
  content: '';
  position: absolute;
  top: -32px; left: -32px;
  width: 78px; height: 78px;
  background: #effef8;
  border-radius: 50%;
  z-index: 0;
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 0.26s;
  animation: pop-in 0.9s 0.18s backwards;
}
.section:nth-child(2):before {
  background: #e7ebfa;
  left: auto; right: -32px; top: auto; bottom: -32px;
}

/* Fun Font for Headings (Montserrat) + Slight Color Animations */
h1, h2 {
  text-shadow: 0 2px 0 #0a4457;
  background: linear-gradient(89deg, #23456e 53%, #1ecba8 85%, #ffae34 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  animation: heading-gradient-move 7s ease-in-out infinite alternate;
}
@keyframes heading-gradient-move {
  0% { background-position: 0% 60%; }
  100% { background-position: 53% 100%; }
}

/* Playful Dot/Edy Animation for Buttons */
.btn:after {
  content: '';
  display: inline-block;
  margin-left: 9px;
  vertical-align: middle;
  width: 9px; height: 9px;
  background: var(--color-accent2);
  border-radius: 50%;
  box-shadow: 0 1px 4px #ffae3433;
  transform: scale(1);
  transition: background 0.2s, transform 0.22s;
  animation: btn-dot-bounce 2s infinite cubic-bezier(.65,.48,.5,1.2) alternate;
}
@keyframes btn-dot-bounce {
  0% { transform: scale(1); }
  60% { transform: scale(1.13) translateY(-2px); }
  100% { transform: scale(1); }
}
.btn-secondary:after {
  background: var(--color-primary);
}
.btn:hover:after, .btn:focus:after { background: var(--color-secondary); transform: scale(1.17); }

/* Miscellaneous Standards */
section + section { margin-top: 32px; }
input, button, select, textarea {
  font-family: inherit; font-size: inherit;
  border-radius: 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td { padding: 8px 6px; border: 1px solid #e6ecee; }

::-webkit-scrollbar {
  width: 9px; background: #e6ecee;
}
::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: 5px;
}

/* For a11y: Focus outlines on interaction */
a:focus, button:focus {
  outline: 2px solid var(--color-accent2);
  outline-offset: 2px;
}


/* =========================================================== */
/* == END OF STYLE.CSS == */
/* =========================================================== */
