/*
 * Telia Newsletter CloudPage stylesheet
 * Purpose-built replacement for the newsletter campaign CloudPage.
 * Preserves the page-critical behavior from inuse.css and adopts the
 * cleaner Telia styling direction found in shouldbe.css.
 */

/* === Brand tokens === */
:root {
  --telia-purple-900: #29003e;
  --telia-purple-700: #5e0092;
  --telia-purple-500: #990ae3;
  --telia-purple-300: #de99ff;
  --telia-purple-050: #fbf0ff;
  --telia-text: #000000;
  --telia-text-muted: #666666;
  --telia-border: #8a8a8a;
  --telia-border-light: #e4e4e4;
  --telia-surface-muted: #f6f6f6;
  --telia-surface: #ffffff;
  --telia-error: #e4175c;
  --telia-success: #00a552;
  --content-width: 1180px;
  --form-width: 680px;
  --radius-small: 3px;
  --radius-card: 8px;
}

/* === Fonts preserved from inuse.css === */
@font-face {
  font-family: "Telia Sans";
  src: url("https://pakkumised.telia.ee/unsubscribe/TeliaSans-Regular.woff2") format("woff2"),
       url("https://pakkumised.telia.ee/unsubscribe/TeliaSans-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Telia Sans";
  src: url("https://pakkumised.telia.ee/unsubscribe/TeliaSans-Bold.woff2") format("woff2"),
       url("https://pakkumised.telia.ee/unsubscribe/TeliaSans-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Telia Sans Heading";
  src: url("https://res.cloudinary.com/telia/raw/upload/v1660825776/MarTech/Telia%20Sans%20Fonts/TeliaSansHeading-Heading.woff2") format("woff2"),
       url("https://res.cloudinary.com/telia/raw/upload/v1660825776/MarTech/Telia%20Sans%20Fonts/TeliaSansHeading-Heading.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* === Reset and accessibility === */
html {
  box-sizing: border-box;
  width: 100%;
  font-family: "Telia Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: inherit; }

body {
  width: 100%;
  min-width: 320px;
  margin: 0;
  color: var(--telia-text);
  background: var(--telia-surface);
  font-family: "Telia Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, iframe { border: 0; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { color: inherit; font: inherit; }
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; }

*:focus-visible {
  outline: 2px solid var(--telia-purple-700) !important;
  outline-offset: 2px !important;
}

/* === Typography and links === */
h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  color: #fff;
  font-family: "Telia Sans Heading", "Telia Sans", Arial, sans-serif;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1;
  font-weight: 700;
  text-transform: none;
}

h2 {
  margin-bottom: 8px;
  color: inherit;
  font-family: "Telia Sans Heading", "Telia Sans", Arial, sans-serif;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

strong, b { font-weight: 700; }

a {
  color: var(--telia-purple-700);
  font-weight: 700;
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover { color: var(--telia-purple-500); }
a:visited { color: var(--telia-purple-700); }
a[style*="underline"], .is-underlined { text-decoration: underline; }

ul { margin: 12px 0 20px; padding-left: 24px; }
li + li { margin-top: 6px; }

/* === Core page layout preserved for current HTML === */
.bg-primary-4 { background-color: #fff; }
.main { display: flex; flex-direction: column; min-height: 100vh; }
.main__inner { display: flex; flex: 1 0 auto; flex-direction: column; min-height: 100vh; }
.main__content { flex: 1 0 auto; padding: 0 0 72px; }
.main__footer { flex-shrink: 0; }

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding-right: 15px;
  padding-left: 15px;
}

.grid {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  padding-left: 0;
}
.grid--center-xs { justify-content: center; }
.grid--between-xs { justify-content: space-between; }
.grid__col { position: relative; width: 100%; max-width: 100%; }
.grid__col--xs { flex: 0 1 auto; width: auto; }
.grid--gutter-default { margin-right: -10px; margin-left: -10px; }
.grid--gutter-default > .grid__col { padding-right: 10px; padding-left: 10px; }
.grid--gutter-medium { margin-right: -20px; margin-left: -20px; }
.grid--gutter-medium > .grid__col { padding-right: 20px; padding-left: 20px; }

.body_margin {
  width: 100%;
  margin-right: 24px;
  margin-left: 24px;
}

/* === Header and logo === */
.main__header { padding-top: 0; }
.header { position: relative; z-index: 2; min-width: 320px; background: #fff; }
.header__top { background: #fff; }
.header__content { position: relative; padding: 14px 0; background: #fff; }
.logo { display: block; width: 75px; height: auto; }

.header-with-bg {
  display: flex;
  min-height: 300px;
  align-items: center;
  color: #fff;
  background-color: var(--telia-purple-900);
  background-image: url("https://image.asiakas.telia.fi/lib/fe9313737464027477/m/5/4fc0cf53-8ade-4cba-a22a-55663ae3e983.png");
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: cover;
}

.header-text { padding-top: 48px; padding-bottom: 48px; }
.white-header { display: block; max-width: 900px; color: #fff; }

/* === Newsletter content width === */
.body_margin > b:first-of-type,
.body_margin > ul,
.body_margin > .newsletter-form-card,
.body_margin > .winners-section {
  max-width: 760px;
}

/* === Newsletter introduction === */

.newsletter-content {
  width: 100%;
  max-width: var(--form-width);
  margin: 32px 0 0;
}

.newsletter-content p {
  margin-bottom: 12px;
}

.newsletter-content ul {
  margin-top: 12px;
  margin-bottom: 24px;
}

/*=== Polished info section of the page ===*/
.campaign-highlight {
    width: 100%;
    max-width: var(--form-width);

    margin: 28px 0 32px;
    padding: 20px 24px;



    border-left: 4px solid var(--telia-purple-500);
    border-radius: 0 8px 8px 0;
}

.campaign-highlight p {
    margin: 0 0 8px;
    line-height: 1.5;
}

.campaign-highlight a {
    display: inline-block;
    text-decoration: underline;
}
/* === Polished newsletter form card === */
.newsletter-form-card {
  width: 100%;
  max-width: var(--form-width);
  margin: 32px 0 48px;
  padding: 32px;
  color: var(--telia-text);
  background: var(--telia-purple-050);
  border: 1px solid rgba(94, 0, 146, 0.12);
  border-radius: var(--radius-card);
}

.newsletter-form-header { margin-bottom: 24px; }
.newsletter-form-header h2 { margin-bottom: 8px; }
.newsletter-form-header p { margin-bottom: 0; color: var(--telia-text); }

.form-container {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
}

.form { width: 100%; text-align: left; }
.form-field { margin: 20px 0 0; }
.form-field:first-child { margin-top: 0; }
.form-field-label {
  margin: 0 0 7px;
  color: rgba(0, 0, 0, 0.80);
  font-family: "Telia Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
}
.form-field-label label { display: inline-block; }

/* Avoid the old global input rule affecting text fields. */
.form-field-input[type="text"],
.form-field-input[type="email"],
.form-field-input[type="tel"] {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--telia-text);
  background: #fff;
  border: 1px solid var(--telia-border);
  border-radius: var(--radius-small);
  box-shadow: none;
  font-size: 16px;
  line-height: 24px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field-input:hover { border-color: var(--telia-text); }
.form-field-input:focus {
  border-color: var(--telia-purple-700);
  outline: 2px solid var(--telia-purple-700);
  outline-offset: 2px;
}
.form-field-input::placeholder { color: var(--telia-text-muted); opacity: 1; }

/* === Existing checkbox markup preserved and improved === */
.checkbox-wrapper-21 { margin-top: 20px; }
.checkbox-wrapper-21 .control {
  position: relative;
  display: block;
  width: auto;
  min-height: 25px;
  margin: 0;
  padding-left: 38px;
  color: var(--telia-text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}
.checkbox-wrapper-21 .control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.checkbox-wrapper-21 .control__indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  background: #fff;
  border: 1px solid var(--telia-border);
  border-radius: var(--radius-small);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.checkbox-wrapper-21 .control:hover input:not(:disabled) ~ .control__indicator {
  border-color: var(--telia-purple-700);
}
.checkbox-wrapper-21 .control input:focus-visible ~ .control__indicator {
  outline: 2px solid var(--telia-purple-700);
  outline-offset: 2px;
}
.checkbox-wrapper-21 .control input:checked ~ .control__indicator {
  background: var(--telia-purple-900);
  border-color: var(--telia-purple-900);
}
.checkbox-wrapper-21 .control__indicator::after {
  content: "";
  position: absolute;
  display: none;
  left: 9px;
  top: 5px;
  width: 4px;
  height: 10px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.checkbox-wrapper-21 .control input:checked ~ .control__indicator::after { display: block; }
.checkbox-wrapper-21 .control input:disabled ~ .control__indicator { opacity: .5; cursor: default; }

/* === Primary button preserved from inuse.css === */
.btn {
  position: relative;
  display: inline-block;
  min-width: 150px;
  max-width: 100%;
  min-height: 42px;
  margin: 24px 0 0;
  padding: 8px 24px;
  color: #fff;
  background: var(--telia-purple-900);
  border: 2px solid var(--telia-purple-900);
  border-radius: 24px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
  letter-spacing: .2px;
  text-align: center;
  text-transform: none;
  vertical-align: middle;
  transition: 150ms ease;
  transition-property: background-color, border-color, color;
}
.btn:hover, .btn.is-active {
  color: #fff;
  background: var(--telia-purple-700);
  border-color: var(--telia-purple-700);
}
.btn:disabled { opacity: .4; cursor: default; }
.btn__inner { display: flex; min-height: 24px; align-items: center; justify-content: center; }
.btn__text { display: inline-block; }

.newsletter-form-note {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--telia-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* === Winners section === */
.winners-section {
  width: 100%;
  max-width: 760px;
  margin: 0 0 48px;
  padding-top: 32px;
  border-top: 1px solid var(--telia-border-light);
}
.winners-section h2 { margin-bottom: 16px; font-size: 24px; }
.winners-list { margin: 0; padding: 0; list-style: none; }
.winners-list li { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--telia-border-light); }
.winner-period { display: block; margin-bottom: 4px; font-weight: 700; }

/* === Footer preserved for current HTML === */
.footer { padding: 0; text-align: center; }
.footer__footer {
  padding: 40px 0;
  color: rgba(255, 255, 255, .82);
  background: #1f002e;
  font-size: 16px;
}
.footer__copyright { padding-bottom: 16px; text-align: center; }
.footer__copyright-link {
  position: relative;
  display: inline-block;
  margin: 8px 12px;
  color: rgba(255, 255, 255, .82);
  font-weight: 400;
}
.footer__copyright-link:visited { color: #fff; }
.footer__copyright-link:hover { color: #fff; }
#copyright { margin: 0; color: rgba(255, 255, 255, .82); }
#link { color: rgba(255, 255, 255, .82); }
.separator, hr { display: block; margin: 0; border: 0; border-top: 1px solid var(--telia-border-light); }
.separator--invisible { border-color: transparent; }
.separator--xxsmall { margin-top: 8px; margin-bottom: 8px; }

/* === SFMC layout-canvas compatibility === */
.layout-canvas-g { width: 100%; padding: 0; border: 0 solid transparent; box-sizing: border-box; }
.layout-canvas-g > .header,
.layout-canvas-g > .section,
.layout-canvas-g > .footer { position: relative; width: 100%; overflow: hidden; overflow-wrap: break-word; }
.layout-canvas-g > .section { margin: 10px 0; }
.layout-canvas-g > .section > .columns { box-sizing: border-box; overflow-wrap: break-word; }

/* === Responsive === */
@media (min-width: 600px) {
  .container { padding-right: 20px; padding-left: 20px; }
}

@media (min-width: 1000px) {
  .container { padding-right: 30px; padding-left: 30px; }
}

@media (max-width: 767px) {
  .header-with-bg { min-height: 240px; background-position: center; }
  .header-text { padding-top: 36px; padding-bottom: 36px; }
  .main__content { padding-bottom: 56px; }
}

@media (max-width: 599px) {
  .grid--gutter-default,
  .grid--gutter-medium { margin-right: -7px; margin-left: -7px; }
  .grid--gutter-default > .grid__col,
  .grid--gutter-medium > .grid__col { padding-right: 7px; padding-left: 7px; }
  .body_margin { margin-right: 16px; margin-left: 16px; }
  .newsletter-form-card { max-width: 100%; margin: 24px 0 40px; padding: 24px 16px; }
  .newsletter-form-header h2 { font-size: 24px; }
  .form-field-input[type="text"],
  .form-field-input[type="email"],
  .form-field-input[type="tel"] { max-width: none; }
  .checkbox-wrapper-21 .control { padding-left: 36px; font-size: 15px; }
  .btn { width: 100%; min-width: 0; }
  .footer__copyright { padding: 0 16px 24px; }
}

@media print {
  a, a:visited { text-decoration: underline; }
  .newsletter-form-card { border: 1px solid #8a8a8a; background: #fff; }
}
