/* Premium Styling for Patient Signup */
.signup-page [hidden] {
  display: none !important;
}

.signup-container {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: radial-gradient(circle at 10% 20%, rgba(56, 152, 203, 0.04) 0%, rgba(255, 255, 255, 0) 90%);
  font-family: "Poppins", sans-serif;
}

.signup-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  border: 1px solid rgba(56, 152, 203, 0.15);
  box-shadow: 0 12px 40px rgba(56, 152, 203, 0.06);
  transition: all 0.3s ease;
}

.signup-header {
  text-align: center;
  margin-bottom: 30px;
}

.signup-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1c2023;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.signup-header p {
  font-size: 14px;
  color: #7d8489;
  font-weight: 400;
}

.signup-step {
  display: none;
}

.signup-step.active {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modern Floating Labels */
.signup-form-group {
  position: relative;
  margin-bottom: 18px;
}

.name-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-input {
  width: 100% !important;
  height: 56px !important;
  padding: 10px 16px 0 !important;
  border: 1.5px solid #d8e8ef !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #1c2023 !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.form-input:focus {
  border-color: #3898cb !important;
  box-shadow: 0 0 0 4px rgba(56, 152, 203, 0.08) !important;
}

.form-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #7d8489;
  pointer-events: none;
  transition: all 0.2s ease;
}

.form-input:focus~.form-label,
.form-input:not(:placeholder-shown)~.form-label {
  top: 14px;
  font-size: 11px;
  color: #3898cb;
  font-weight: 600;
}

/* Special select styling */
.select-container {
  position: relative;
  margin-bottom: 18px;
}

.form-select {
  width: 100% !important;
  height: 56px !important;
  padding: 0 40px 0 16px !important;
  border: 1.5px solid #d8e8ef !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #1c2023 !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.form-select:focus {
  border-color: #3898cb !important;
  box-shadow: 0 0 0 4px rgba(56, 152, 203, 0.08) !important;
}

.select-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #7d8489;
}

/* Phone Input with absolute prefix */
.phone-group {
  position: relative;
  margin-bottom: 18px;
}

.phone-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: #1c2023;
  pointer-events: none;
  z-index: 2;
}

.phone-group:has(.phone-input:focus) .phone-prefix,
.phone-group:has(.phone-input:not(:placeholder-shown)) .phone-prefix {
  top: calc(50% + 5px);
}

.phone-input {
  padding-left: 66px !important;
}

/* Password toggle eye */
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: #7d8489;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #3898cb;
  background: rgba(56, 152, 203, 0.08);
  outline: none;
}

.password-input {
  padding-right: 52px !important;
}

.field-error {
  display: none;
  margin: -10px 4px 18px;
  color: #c7352c;
  font-size: 12px;
  line-height: 1.4;
}

.field-error.visible {
  display: block;
}

.form-input[aria-invalid="true"] {
  border-color: #c7352c !important;
}

/* Password checklist requirements */
.password-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 18px;
}

.req-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 500;
  background: #f1f3f5;
  color: #7d8489;
  transition: all 0.2s ease;
}

.req-badge svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 3;
  display: none;
}

.req-badge.valid {
  background: rgba(56, 152, 203, 0.1);
  color: #2678a8;
}

.req-badge.valid svg {
  display: inline-block;
}

/* OTP code block layout */
.otp-container {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 24px 0;
}

.otp-box,
input.otp-box,
.otp-container input.otp-box {
  border: 2px solid #d8e8ef !important;
  border-radius: 10px !important;
  text-align: center !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #1c2023 !important;
  background-color: #ffffff !important;
  background: #ffffff !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.otp-box:focus,
input.otp-box:focus,
.otp-container input.otp-box:focus {
  border-color: #3898cb !important;
  box-shadow: 0 0 0 4px rgba(56, 152, 203, 0.08) !important;
}

/* Buttons */
.btn-submit {
  width: 100%;
  height: 56px;
  background: linear-gradient(180deg, #67c1f1 0%, #3898cb 100%);
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff !important;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(56, 152, 203, 0.2);
  margin-top: 15px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 152, 203, 0.35);
}

.btn-submit:disabled {
  background: linear-gradient(180deg, #b2dff7 0%, #9ccce6 100%);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success View */
.success-view {
  text-align: center;
  padding: 10px 0;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e6f7ee;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: #1a7a4a;
}

.download-badges {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #000000;
  color: #ffffff !important;
  padding: 10px 22px;
  border-radius: 12px;
  text-decoration: none;
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.download-text-small {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.2;
}

.download-text-big {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

/* Toast system */
.zh-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  background: #1c2023;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zh-toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 576px) {
  .signup-container {
    padding: 32px 20px;
  }

  .signup-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .signup-header {
    margin-bottom: 24px;
  }

  .name-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .zh-toast {
    right: 16px;
    left: 16px;
    top: 16px;
    transform: translateY(-80px);
  }
}

.zh-toast.error {
  border-left: 4px solid #ea4335;
}

.zh-toast.success {
  border-left: 4px solid #34a853;
}

/* Keep the resend control and its countdown together on their own line so the
   only tappable element in the block is not crowded on narrow screens. */
.resend-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 14px;
}

.resend-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.timer-text {
  font-size: 14px;
  font-weight: 600;
  color: #1c2023;
}

.timer-expired {
  color: #ea4335;
}

.btn-ghost-resend {
  background: none;
  border: none;
  color: #3898cb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
}

/* Ghost buttons are inline by default; center them on their own row. */
.btn-ghost-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.btn-ghost-resend:disabled {
  color: #b2dff7;
  cursor: not-allowed;
  text-decoration: none;
}

/* Modal overlay and content styling */
.signup-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.signup-success-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.signup-success-content {
  background: #ffffff;
  padding: 40px 32px;
  border-radius: 20px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signup-success-overlay.active .signup-success-content {
  transform: translateY(0);
}

.signup-success-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 300;
  color: #7d8590;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.signup-success-close:hover {
  color: #1c2023;
}

.signup-success-desc {
  font-size: 15px;
  color: #5b6267;
  margin-bottom: 24px;
  line-height: 1.5;
  text-align: center;
}
