/* ===== REJESTRACJA FREE I PRO ===== */

.auth-page {
  --registration-primary: #315f9b;
  --registration-primary-hover: #244c7f;
  --registration-primary-soft: #dce9f7;
  --registration-pro: #1667c5;
  --registration-pro-hover: #0f55a7;
  --registration-text: #152033;
  --registration-muted: #526174;
  --registration-border: #aab8c8;
  --registration-border-strong: #8292a6;
  --registration-surface: #e6edf4;
  --registration-surface-soft: #d2dce7;
  --registration-page: #1c2a3d;
  --registration-danger: #b42318;
  --registration-danger-bg: #fff1f0;
  --registration-danger-border: #fecdca;
  --registration-success: #067647;
  --registration-success-bg: #ecfdf3;
  --registration-success-border: #abefc6;
  --registration-info: #315d9d;
  --front-muted-text-color: #cbd5e1;
  width: 100%;
  min-width: 0;
  padding: 42px clamp(14px, 3vw, 32px) 24px;
  background:
    radial-gradient(circle at 14% 0%, rgba(92, 145, 202, 0.34) 0, rgba(92, 145, 202, 0) 420px),
    radial-gradient(circle at 88% 12%, rgba(48, 96, 154, 0.30) 0, rgba(48, 96, 154, 0) 380px),
    linear-gradient(180deg, #1a2739 0%, #26384d 48%, #192638 100%);
  color: var(--registration-text);
}

.auth-intro {
  position: relative;
  width: min(100%, 820px);
  max-width: 820px;
  margin-bottom: 26px;
  padding: 0 clamp(4px, 2vw, 18px);
}

.auth-intro h2 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.28);
}

.auth-intro p {
  max-width: 690px;
  margin: 13px auto 0;
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.auth-intro p > strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 3px;
  color: #f8fafc;
  font-weight: 500;
}

#selectedPlanName {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 5px 13px;
  border: 1px solid #9db4cd;
  border-radius: 999px;
  background: #dce7f2;
  color: #203a5a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

body[data-registration-entry="pro"] #selectedPlanName,
body[data-registration-plan="pro"] #selectedPlanName {
  border-color: #8db7ea;
  background: #d9eaff;
  color: #124d92;
}

#selectedPlanHint {
  display: inline-block;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth-page .register-box {
  width: min(100%, 820px);
  max-width: 820px;
  min-width: 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #8d9db0;
  border-radius: 18px;
  background: linear-gradient(180deg, #e9eff5 0%, #dce5ee 100%);
  box-shadow:
    0 28px 70px rgba(8, 15, 28, 0.32),
    0 6px 18px rgba(8, 15, 28, 0.16);
}

.auth-page .register-box > h2 {
  margin: 0 0 27px;
  color: #17243a;
  font-size: clamp(23px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-align: center;
}

#registerForm {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.register-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid #a3b2c3;
  border-radius: 14px;
  background: #ced9e4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 4px 12px rgba(26, 39, 57, 0.06);
}

.register-section h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0 0 2px;
  color: #18283f;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.register-section h3::after {
  content: "";
  flex: 1 1 auto;
  min-width: 24px;
  height: 1px;
  background: #9eadbd;
}

.register-box input[type="text"]:not(.registration-honeypot),
.register-box input[type="email"],
.register-box input[type="password"],
.register-box input[type="tel"],
.register-box textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #8494a7;
  border-radius: 11px;
  background: #f8fafc;
  color: var(--registration-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.register-box textarea {
  min-height: 96px;
  resize: vertical;
}

.register-box input:not(.registration-honeypot)::placeholder,
.register-box textarea::placeholder {
  color: #5c6a7d;
  font-weight: 400;
  opacity: 1;
}

.register-box input[type="text"]:not(.registration-honeypot):hover:not(:disabled):not([readonly]),
.register-box input[type="email"]:hover:not(:disabled):not([readonly]),
.register-box input[type="password"]:hover:not(:disabled):not([readonly]),
.register-box input[type="tel"]:hover:not(:disabled):not([readonly]),
.register-box textarea:hover:not(:disabled):not([readonly]) {
  border-color: #61748b;
  background: #ffffff;
}

.register-box input[type="text"]:not(.registration-honeypot):focus,
.register-box input[type="email"]:focus,
.register-box input[type="password"]:focus,
.register-box input[type="tel"]:focus,
.register-box textarea:focus {
  border-color: var(--registration-primary);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(49, 95, 155, 0.20),
    0 6px 14px rgba(30, 53, 82, 0.08);
}

.register-box input[type="text"]:not(.registration-honeypot):focus-visible,
.register-box input[type="email"]:focus-visible,
.register-box input[type="password"]:focus-visible,
.register-box input[type="tel"]:focus-visible,
.register-box textarea:focus-visible {
  outline: 2px solid var(--registration-primary);
  outline-offset: 2px;
}

.register-box input[type="text"]:not(.registration-honeypot):invalid:not(:placeholder-shown),
.register-box input[type="email"]:invalid:not(:placeholder-shown),
.register-box input[type="password"]:invalid:not(:placeholder-shown),
.register-box input[type="tel"]:invalid:not(:placeholder-shown),
.register-box textarea:invalid:not(:placeholder-shown) {
  border-color: #d92d20;
  background: #fffafa;
}

.register-box input[type="text"]:not(.registration-honeypot):valid:not(:placeholder-shown),
.register-box input[type="email"]:valid:not(:placeholder-shown),
.register-box input[type="password"]:valid:not(:placeholder-shown),
.register-box input[type="tel"]:valid:not(:placeholder-shown),
.register-box textarea:valid:not(:placeholder-shown) {
  border-color: #55a982;
}

.register-box input[type="text"]:not(.registration-honeypot):disabled,
.register-box input[type="email"]:disabled,
.register-box input[type="password"]:disabled,
.register-box input[type="tel"]:disabled,
.register-box textarea:disabled,
.register-box input[type="text"]:not(.registration-honeypot)[readonly],
.register-box input[type="email"][readonly],
.register-box input[type="password"][readonly],
.register-box input[type="tel"][readonly],
.register-box textarea[readonly] {
  border-color: #cbd5e1;
  background: #e9edf2;
  color: #526071;
  cursor: not-allowed;
}

.field-hint {
  display: block;
  min-width: 0;
  margin: -5px 0 2px;
  color: #536175;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.register-section > label:not(.password-toggle-row) {
  margin: 0 0 -4px;
  color: var(--registration-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.login-password-field {
  min-width: 0;
}

.register-box .login-password-field input {
  margin: 0;
  padding-right: 54px;
}

.register-box .login-toggle-password {
  border: 1px solid transparent;
  background: transparent;
  color: var(--registration-primary);
}

.register-box .login-toggle-password:hover:not(:disabled) {
  border-color: #d5e1f0;
  background: var(--registration-primary-soft);
  color: var(--registration-primary-hover);
}

.register-box .login-toggle-password:focus-visible {
  outline: 2px solid var(--registration-primary);
  outline-offset: 2px;
  box-shadow: none;
}

.register-box .login-toggle-password:disabled {
  border-color: #d7dee7;
  background: #e9edf2;
  color: #647184;
  opacity: 1;
}

.register-password-strength {
  min-width: 0;
  margin: -5px 0 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.register-password-strength:empty {
  min-height: 0;
  margin: -10px 0 0;
  padding: 0;
  border: 0;
}

.register-password-strength.weak {
  border-color: var(--registration-danger-border);
  background: var(--registration-danger-bg);
  color: var(--registration-danger);
}

.register-password-strength.medium {
  border-color: #fedf89;
  background: #fff8eb;
  color: #8a4b08;
}

.register-password-strength.strong {
  border-color: var(--registration-success-border);
  background: var(--registration-success-bg);
  color: var(--registration-success);
}

/* Pole pułapka pozostaje poza obszarem widocznym i interaktywnym. */
.registration-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.subdomain-address-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

.subdomain-address-field #subdomainSlug {
  width: 100%;
  min-width: 0;
  height: 46px;
  margin: 0;
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.subdomain-address-suffix {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid #8494a7;
  border-left: 0;
  border-radius: 0 11px 11px 0;
  background: #bcc9d7;
  color: #26394f;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.register-box .subdomain-check-btn {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #7e90a5;
  border-radius: 11px;
  background: #bdcad8;
  color: #1f334d;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(30, 50, 73, 0.08);
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.register-box .subdomain-check-btn:hover:not(:disabled) {
  border-color: #5e738c;
  background: #aebdcd;
  color: #14263c;
  transform: none;
  box-shadow: 0 5px 12px rgba(30, 50, 73, 0.12);
}

.register-box .subdomain-check-btn:active:not(:disabled) {
  background: #a4b4c5;
}

.register-box .subdomain-check-btn:focus-visible {
  outline: 2px solid var(--registration-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(49, 93, 157, 0.16);
}

.register-box .subdomain-check-btn:disabled {
  border-color: #b8c3d0;
  background: #e4e9ef;
  color: #4e5c6e;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.subdomain-availability-message {
  display: block;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--registration-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.subdomain-availability-message.is-success {
  border-color: var(--registration-success-border);
  background: var(--registration-success-bg);
  color: var(--registration-success);
}

.subdomain-availability-message.is-error {
  border-color: var(--registration-danger-border);
  background: var(--registration-danger-bg);
  color: var(--registration-danger);
}

.subdomain-availability-message.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--registration-info);
}

/* ===== PLAN PRO ===== */

.pro-registration-card {
  border-color: #7599c5;
  background: linear-gradient(145deg, #d5e4f4 0%, #c5d8ec 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 6px 16px rgba(31, 75, 125, 0.10);
}

.pro-registration-card h3 {
  color: #174f8d;
}

.pro-registration-card h3::after {
  background: #88a9ce;
}

.pro-registration-lead,
.pro-registration-summary,
.pro-registration-message,
.pro-registration-submit-hint {
  min-width: 0;
  margin: 0;
  color: var(--registration-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.pro-registration-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 2px 0 0;
}

.pro-registration-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #9cacc0;
  border-radius: 12px;
  background: #f6f9fc;
  color: var(--registration-text);
  cursor: pointer;
  box-shadow:
    0 5px 13px rgba(25, 54, 88, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.80);
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.pro-registration-option:hover {
  border-color: #6489b7;
  background: #edf5fd;
  box-shadow:
    0 7px 16px rgba(25, 74, 130, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.pro-registration-option input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--registration-pro);
}

.pro-registration-option span {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pro-registration-option strong {
  color: var(--registration-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.pro-registration-option em {
  color: #145cae;
  font-size: 19px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.3;
}

.pro-registration-option small {
  color: var(--registration-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.pro-registration-option:has(input:checked) {
  border-color: #1768c6;
  background: linear-gradient(145deg, #e2efff 0%, #cfe3fb 100%);
  box-shadow:
    0 0 0 3px rgba(23, 104, 198, 0.16),
    0 9px 20px rgba(26, 85, 151, 0.16);
}

.pro-registration-option:has(input:focus-visible) {
  outline: 2px solid var(--registration-pro);
  outline-offset: 3px;
}

.pro-registration-option:has(input:disabled) {
  border-color: #cbd5e1;
  background: #e9edf2;
  color: #526071;
  cursor: not-allowed;
}

.pro-registration-summary,
.pro-registration-submit-hint {
  padding: 10px 12px;
  border: 1px solid #91afd1;
  border-radius: 10px;
  background: #d7e6f5;
  color: #234d7c;
  font-weight: 500;
}

.pro-registration-message {
  min-height: 21px;
}

.pro-registration-message.is-error {
  padding: 9px 11px;
  border: 1px solid var(--registration-danger-border);
  border-radius: 9px;
  background: var(--registration-danger-bg);
  color: var(--registration-danger);
  font-weight: 500;
}

/* ===== ZGODY I AKCJE ===== */

.register-box .password-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #a4b3c3;
  border-radius: 11px;
  background: #e9eff5;
  color: #3d4d61;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

.register-box .password-toggle-row input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--registration-primary);
}

.register-box .password-toggle-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.register-box .password-toggle-row a {
  color: var(--registration-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.register-box .password-toggle-row a:hover {
  color: var(--registration-primary-hover);
}

.register-box .password-toggle-row a:focus-visible,
.register-box .password-toggle-row input:focus-visible {
  outline: 2px solid var(--registration-primary);
  outline-offset: 3px;
}

#registerForm > button[type="submit"] {
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid #28568d;
  border-radius: 13px;
  background: linear-gradient(180deg, #3974b7 0%, #285d99 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.005em;
  white-space: normal;
  cursor: pointer;
  box-shadow:
    0 10px 22px rgba(32, 79, 132, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

#registerForm > button[type="submit"]:hover:not(:disabled) {
  border-color: #214b7d;
  background: linear-gradient(180deg, #326aaa 0%, #214f85 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow:
    0 14px 28px rgba(32, 79, 132, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

#registerForm > button[type="submit"]:active:not(:disabled) {
  transform: none;
  box-shadow:
    0 6px 14px rgba(32, 79, 132, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#registerForm > button[type="submit"]:focus-visible {
  outline: 2px solid var(--registration-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(49, 93, 157, 0.18);
}

#registerForm > button[type="submit"]:disabled {
  border-color: #637286;
  background: #637286;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

body[data-registration-entry="pro"] #registerForm > button[type="submit"],
body[data-registration-plan="pro"] #registerForm > button[type="submit"] {
  border-color: #0e5eb9;
  background: linear-gradient(180deg, #1975da 0%, #0d5fb9 100%);
  box-shadow:
    0 11px 24px rgba(13, 95, 185, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

body[data-registration-entry="pro"] #registerForm > button[type="submit"]:hover:not(:disabled),
body[data-registration-plan="pro"] #registerForm > button[type="submit"]:hover:not(:disabled) {
  border-color: #0a4f9e;
  background: linear-gradient(180deg, #136bca 0%, #0953a5 100%);
  box-shadow:
    0 15px 30px rgba(10, 79, 158, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body[data-registration-entry="pro"] #registerForm > button[type="submit"]:disabled,
body[data-registration-plan="pro"] #registerForm > button[type="submit"]:disabled {
  border-color: #637286;
  background: #637286;
}

.register-box .error {
  min-width: 0;
  margin: 0;
  color: var(--registration-danger);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.register-box .error.visible {
  padding: 10px 12px;
  border: 1px solid var(--registration-danger-border);
  border-radius: 10px;
  background: var(--registration-danger-bg);
}

/* ===== STOPKA NA CIEMNYM TLE ===== */

.auth-page .app-footer {
  --color-primary: #f1f5f9;
  color: #cbd5e1 !important;
}

.auth-page .app-footer a {
  color: #e7eef7;
}

.auth-page .app-footer a:hover {
  color: #ffffff;
}

/* ===== RESPONSYWNOŚĆ ===== */

@media (max-width: 768px) {
  .auth-page {
    padding: 30px 16px 20px;
  }

  .auth-page .register-box {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .register-section {
    padding: 17px;
  }
}

@media (max-width: 640px) {
  .subdomain-address-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .subdomain-address-field #subdomainSlug {
    width: 100%;
    border-right: 1px solid var(--registration-border-strong);
    border-radius: 11px 11px 0 0;
  }

  .subdomain-address-suffix {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--registration-border-strong);
    border-top: 0;
    border-radius: 0 0 11px 11px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .pro-registration-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .auth-page {
    padding: 22px 10px 16px;
  }

  .auth-intro {
    margin-bottom: 16px;
  }

  .auth-intro h2 {
    font-size: 27px;
  }

  .auth-intro p {
    font-size: 14px;
  }

  .auth-page .register-box {
    padding: 18px 12px;
    border-radius: 14px;
  }

  .auth-page .register-box > h2 {
    margin-bottom: 19px;
    font-size: 21px;
  }

  #registerForm {
    gap: 14px;
  }

  .register-section {
    gap: 11px;
    padding: 14px;
    border-radius: 12px;
  }

  .register-section h3 {
    font-size: 15px;
  }

  .register-box input[type="text"]:not(.registration-honeypot),
  .register-box input[type="email"],
  .register-box input[type="password"],
  .register-box input[type="tel"],
  .register-box textarea {
    font-size: 16px;
  }

  .subdomain-address-suffix {
    font-size: 13px;
  }

  .register-box .password-toggle-row {
    padding: 12px;
    font-size: 13px;
  }

  #registerForm > button[type="submit"] {
    min-height: 52px;
    padding-right: 14px;
    padding-left: 14px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page,
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
