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;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

body {
  line-height: 1.5;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

mark {
  all: unset;
}

button {
  all: unset;
  cursor: pointer;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

input,
textarea,
select {
  cursor: text;
  box-sizing: border-box;
  border-radius: 0;
  font-family: inherit;
}

html {
  font-size: 14px;
  font-family: "Raleway";
  font-weight: 400;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  interpolate-size: allow-keywords;
}
@media (min-width: 460px) {
  html {
    font-size: 16px;
  }
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: #f9f9f9;
}

.simple-page {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1;
  position: relative;
  flex: 1;
  padding: 1rem;
}

.btn {
  font-size: 1.125rem;
  display: inline-block;
  background: #1A1A1A;
  color: #FFFFFF;
  border-radius: 5rem;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  position: relative;
  z-index: 2;
  font-weight: 500;
  padding: 0.875rem 2rem;
  line-height: 1.2;
  gap: 1rem;
  width: -moz-fit-content;
  width: fit-content;
  transition: 0.2s;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: #243f51;
}

.btn--sms {
  width: 100%;
  display: block;
  margin: 0 auto;
  max-width: 20.5rem;
}

.logo {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo__img {
  height: 2.5rem;
  width: auto;
  display: block;
}

.title {
  font-weight: 600;
  font-size: 1.5rem;
  text-align: center;
}

.start-title {
  font-weight: 400;
  padding: 1rem 0 2rem;
  font-size: 1.25rem;
  max-width: 30ch;
  text-align: center;
  line-height: 1.3;
}

.footer {
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
  border-top: 1px solid #f2f2f2;
  color: #1A1A1A;
}
/* === NOWE STYLE DLA SYSTEMU UMÓW === */

/* Container i layout */
.contract-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
}

/* Kroki procesu */
.step {
  display: none;
}

.step.active {
  display: block;
}

/* Form elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #1A1A1A;
  text-align: center;
}

/* SMS Info */
.sms-info {
  text-align: center;
  color: #666;
  margin: 2rem 0;
  line-height: 1.6;
  display: block;
}

.sms-info strong {
  color: #1A1A1A;
  font-weight: 600;
}

/* SMS Code Inputs - Apple Style (6 osobnych pól) */
.sms-code-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.sms-digit {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  border: 2px solid #e0e0e0;
  border-radius: 0.75rem;
  background: white;
  transition: all 0.2s;
  caret-color: #243f51;
  font-variant-numeric: tabular-nums;
}

.sms-digit:focus {
  outline: none;
  border-color: #243f51;
  box-shadow: 0 0 0 3px rgba(36, 63, 81, 0.1);
}

.sms-digit.filled {
  border-color: #243f51;
  background: #f5f7f9;
}

@media (max-width: 640px) {
  .sms-digit {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
  
  .sms-code-inputs {
    gap: 0.375rem;
  }
}

/* Download PDF Button */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #1A1A1A;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  margin-bottom: 1rem;
  float: right;
  cursor: pointer;
  text-decoration: none;
}

.btn-download:hover {
  color: #243f51;
}

.btn-download__icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

/* Clear float */
.signature-section {
  clear: both;
}

.form-input {
  width: 100%;
  margin: 0 auto;
  display: block;
  padding: 0.875rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.75rem;
  font-size: 1rem;
  text-align: center;
  transition: border-color 0.2s;
  background: white;
  letter-spacing: 0.25rem;
  font-weight: 500;
}

.form-input:focus {
  outline: none;
  border-color: #243f51;
  box-shadow: 0 0 0 3px rgba(36, 63, 81, 0.1);
}

.form-input::placeholder {
  letter-spacing: normal;
  font-weight: 400;
}

@media (max-width: 640px) {
  .form-input {
    font-size: 1.125rem;
    padding: 1rem;
  }
}

.error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
  text-align: center;
}

.error-message.show {
  display: block;
}

.sms-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.fatal-error {
  text-align: center;
  padding: 1rem 2rem;
  color: #fff;
  background: #dc3545;
  border-radius: 8px;
  width: fit-content;
  margin: 2rem auto 0;
}

/* Contract content */
.contract-content {
  background: #fff;
  padding: 2rem;
  border-radius: 0.75rem;
  margin: 2rem 0 .5rem;
  border: 2px solid #e0e0e0;
  line-height: 1.8;
  max-height: 60vh;
  overflow-y: auto;
}

.contract-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #1A1A1A;
}

.contract-content p {
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .contract-content {
    padding: 1.5rem;
    max-height: 50vh;
  }
}

/* Załączniki */
.attachments-section {
  margin: 2rem 0;
}

.attachments-section h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  color: #1A1A1A;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.attachment-item:hover {
  border-color: #267cb5;
}

.attachment-title {
  font-size: 0.875rem;
}

.attachment-item svg {
  flex-shrink: 0;
  color: #000;
}

/* Zgody marketingowe */
.consents-section {
  margin: 3rem 0 0;
}

.consents-section h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  color: #1A1A1A;
}

.consents-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 0.75rem;
  transition: border-color 0.2s;
  cursor: pointer;
}

.consent-item:hover {
  border-color: #ccc;
}

.consent-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #243f51;
  border: 2px solid #e0e0e0;
  border-radius: 0.25rem;
}

.consent-content {
  flex: 1;
}

.consent-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1A1A1A;
}

.consent-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.consent-badge.required {
  background: #154a64;
  color: white;
}

.consent-badge.optional {
  background: #6c757d;
  color: white;
}

/* Responsive */
@media (max-width: 640px) {
  .consents-section {
    padding: 1.5rem;
  }
  
  .consent-item {
    padding: 0.875rem;
  }
  
  .consent-text {
    font-size: 0.875rem;
  }
  
  .consents-section h3 {
    font-size: 1.125rem;
  }
}

/* Signature section */
.signature-section {
  margin-top: 3rem;
}

.signature-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

.signature-pad-wrapper {
  border: 2px solid #e0e0e0;
  border-radius: 0.75rem;
  background: white;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.signature-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 1.5;
  touch-action: none;
  cursor: crosshair;
}


.signature-controls {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: .8125rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .signature-controls {
    display: flex;
    flex-direction: column-reverse;
    gap: 2rem;
  }
}

.signature-controls .btn {
  flex: 1;
  width: 100%;
}

#submit-signature {
  background: #267cb5;
}

.btn-secondary {
  background: #f5f5f5;
  color: #1A1A1A;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.signature-instruction {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Loading state */
.loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.loading.show {
  display: block;
}

/* Success message */
.success-message {
  text-align: center;
  padding: 3rem 1rem;
}

.success-message h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2e7d32;
}

/* Responsive heading */
@media (max-width: 640px) {
  .signature-section h3 {
    font-size: 1.125rem;
  }
}