/* --- Material Design 3 Color System (Light Theme) --- */
:root {
  /* Primary - Corporate Color */
  --md-sys-color-primary: #13bc60;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #a6fcc5;
  --md-sys-color-on-primary-container: #00210e;
  /* Secondary */
  --md-sys-color-secondary: #4d6353;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d0e8d3;
  --md-sys-color-on-secondary-container: #0b1f13;
  --md-sys-color-hover: #44C67E;
  /* Surface */
  --md-sys-color-surface-container-high: #EAEDEC;
  --md-sys-color-surface-container-highest: #F7FAF8;
  --md-sys-color-surface-variant: #fff;
  --md-sys-color-on-surface: #191c19;
  --md-sys-color-on-surface-variant: #414942;
  /* Outline */
  --md-sys-color-outline: #717971;
  /* Error */
  --md-sys-color-error: #ba1a1a;

  /* Elevation (Shadows) */
  --md-sys-elevation-level-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
  --md-sys-elevation-level-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
}

/* --- General Styles --- */
html,
body {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 24px;
  color: #005324;
}

.card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 40px;
  padding: 24px;
}

.logo {
  display: block;
  width: 79px;
  margin: 0 0 12px;
}

.logo-big {
  display: block;
  margin: 0 0 20px;
}

.card-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 24px;
  text-align: left;
  text-transform: uppercase;
}

.card-second-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 24px;
  text-align: center;
  text-transform: uppercase;
}

.card-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  opacity: 0.8;
}

.card-second-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  opacity: 0.8;
}

.section-title {
  margin: 20px 0 8px;
  font-weight: 400;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

/* --- Segmented Control --- */
.seg-control {
  display: flex;
  background-color: var(--md-sys-color-surface-variant);
  padding: 4px;
  border-radius: 128px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  /* тонкая светлая граница */
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border-radius: 128px;
  font-weight: 500;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
}

.tab.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.tab .material-symbols-outlined {
  font-size: 20px;
}

/* --- Chip Row --- */
.chip-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.chip {
  padding: 18px;
  border-radius: 8px;
  background: var(--md-sys-color-surface-variant);
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
  /* тонкая светлая граница */
}

.chip.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.chip-custom {
  grid-column: span 2;
  font-weight: 400;
}

/* Custom Input inside chip */
.chip input {
  border: none;
  outline: none;
  width: 80px;
  background: transparent;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  color: inherit;
}

.chip input::-webkit-outer-spin-button,
.chip input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chip input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.euro {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 500;
}

.hidden {
  display: none;
}

/* --- Payment Element --- */
#payment-element {
  margin: 16px 0 0;
}

/* --- Text Field (Material Design 3 — Floating Label) --- */
.text-field {
  position: relative;
  margin-top: 24px;
}

.text-field input {
  width: 100%;
  padding: 20px 16px 6px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);    /* 1px всегда → без скачков */
  background: var(--md-sys-color-surface-variant);
  font-size: 16px;
  box-sizing: border-box;
  box-shadow: none;                         /* без теней */
  outline: 0;                               /* убираем системный outline */
  transition: border-color 0.2s ease, outline-color 0.2s ease;
}

.text-field input:focus,
.text-field input:focus-visible {
  border: 1px solid var(--md-sys-color-primary);  /* толщина не меняется */
  outline: 1px solid var(--md-sys-color-primary); /* «добавочный» пиксель */
  outline-offset: 0;                              
  box-shadow: none;
}

.text-field label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
  font-size: 14px;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1;
}

.text-field input:focus+label,
.text-field input:not(:placeholder-shown)+label {
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

.text-field input:focus+label,
.text-field input:not(:placeholder-shown)+label {
  top: 6px;
  font-size: 12px;
}

/* --- Filled Button --- */
.filled-button {
  width: 100%;
  padding: 12px;
  margin-top: 24px;
  border-radius: 20px;
  border: 0;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  text-transform: uppercase;
}

.filled-button:hover {
  background: var(--md-sys-color-hover);
}

.filled-button:disabled {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.38);
  box-shadow: none;
  cursor: not-allowed;
}

.muted {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
  font-weight: 400;
  opacity: 0.4;
}

/* Email validation */
.invalid-input {
  border: 1px solid var(--md-sys-color-error) !important;
  outline: 1px solid var(--md-sys-color-error);
  outline-offset: 0;
  box-shadow: none;
}

/* Опционально: для мыши оставляем только фокус-клавиатуры */
.text-field input:focus:not(:focus-visible) {
  outline: 0;
}

.error-message {
  color: var(--md-sys-color-error);
  font-size: 12px;
  margin-top: 6px;
  margin-left: 12px;
}

.filled-button-link {
  display: block;
  text-align: center;
  padding: 12px;
  margin-top: 24px;
  border-radius: 20px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.filled-button-link:hover {
  background: var(--md-sys-color-hover);
}

.agreement-container {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.agreement-container h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.agreement-container h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.agreement-container p {
  margin-bottom: 1rem;
}

.inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.rotate-90 {
  transform: rotate(90deg);
}

.p-Input, .p-FauxInput, .p-Select {
  border-radius: 8px !important;
}

/* --- Footer --- */
.footer {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.footer-links {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
  max-width: 460px; /* совпадает с шириной .card */
  padding: 0 8px;
  box-sizing: border-box;
}

.footer a {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.footer a:hover {
  text-decoration: underline;
}