/* ============================================================================
 * css/public_glass_css.css
 * Shared public-auth theme - single source of truth for the member-facing pages:
 *   index.php (login), registration.php, create_member_error.php,
 *   create_member_successful.php
 *
 * The block below is the design system copied VERBATIM from registration.php
 * (Ultra-Modern Dark Glassmorphism: Inter font, deep teal gradient background,
 * translucent glass cards, cyan #00d4ff accents, rainbow accent bar).
 * Keep these values identical on every page so they all look the same.
 * Body class: auth-glass-page  (registration.php uses register-page).
 * ========================================================================== */

/* ============================================================
         * REGISTRATION PAGE — Ultra-Modern Dark Glassmorphism
         * Matches test_otp.php Design System
         * ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box !important;
}

body.register-page,
body.auth-glass-page {
  font-family: "Inter", sans-serif !important;
  min-height: 100vh !important;
  background: #f5f5f7 url("../assets/images/marble_white_bg.jpg") no-repeat
    center center fixed !important;
  background-image:
    url("../assets/images/marble_white_bg.jpg"),
    url("../assets/images/white_marble_bg.jpg") !important;
  background-size: cover !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 40px 16px !important;
  margin: 0 !important;
  color: #ffffff !important;
}

.register-box {
  width: 100% !important;
  max-width: 480px !important;
  margin: 0 auto !important;
}

/* Logo styling without background box */
.register-logo {
  text-align: center !important;
  margin-bottom: 16px !important;
}

.register-logo a {
  display: inline-block !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.register-logo a:hover {
  transform: translateY(-2px) scale(1.02) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.register-logo img {
  width: 220px !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Main Form Card */
.register-box-body {
  background: #184e68 !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 24px !important;
  padding: 38px 32px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Rainbow accent line at top of card */
.register-box-body::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 4px !important;
  background: linear-gradient(90deg, #00d4ff, #52b788, #f4a261) !important;
}

/* Header Pill Badge */
.badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(0, 212, 255, 0.12) !important;
  border: 1px solid rgba(0, 212, 255, 0.25) !important;
  color: #00d4ff !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  padding: 5px 14px !important;
  border-radius: 50px !important;
  margin-bottom: 12px !important;
}

.login-box-msg {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  margin-bottom: 24px !important;
  text-align: center !important;
  color: #ffffff !important;
  letter-spacing: -0.3px !important;
}

/* Form Groups */
.form-group {
  margin-bottom: 18px !important;
  position: relative !important;
  width: 100% !important;
}

.form-group label {
  display: block !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.4px !important;
  text-transform: uppercase !important;
  margin-bottom: 6px !important;
}

/* Input Controls */
.register-box-body .form-control {
  width: 100% !important;
  height: 50px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-family: "Inter", sans-serif !important;
  padding: 0 16px !important;
  outline: none !important;
  transition: all 0.25s ease !important;
  box-shadow: none !important;
}

.register-box-body .has-feedback .form-control {
  padding-right: 42px !important;
}

.register-box-body .form-control:focus {
  border-color: rgba(0, 212, 255, 0.5) !important;
  background: rgba(0, 212, 255, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
}

.register-box-body .form-control[readonly] {
  background: rgba(255, 255, 255, 0.03) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  cursor: not-allowed !important;
}

.register-box-body .form-control::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

/* Select Dropdown */
.register-box-body select.form-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='rgba(0,212,255,0.7)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  padding-right: 42px !important;
  cursor: pointer !important;
}

.register-box-body select.form-control option {
  background: #1a2730 !important;
  color: #ffffff !important;
  padding: 10px !important;
}

/* Input Group Addon (+91) */
.register-box-body .input-group-addon {
  height: 50px !important;
  padding: 0 16px !important;
  background: rgba(0, 212, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-right: none !important;
  border-radius: 12px 0 0 12px !important;
  color: #00d4ff !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  display: flex !important;
  align-items: center !important;
}

.register-box-body .input-group .form-control {
  border-radius: 0 12px 12px 0 !important;
}

/* Feedback Icons */
.register-box-body .form-control-feedback {
  line-height: 50px !important;
  height: 50px !important;
  width: 42px !important;
  color: rgba(255, 255, 255, 0.35) !important;
  transition: color 0.25s ease !important;
}

.register-box-body .has-feedback:focus-within .form-control-feedback {
  color: #00d4ff !important;
}

/* Success & Error States */
.register-box-body .has-success .form-control {
  border-color: rgba(0, 230, 118, 0.6) !important;
  background: rgba(0, 230, 118, 0.05) !important;
}

.register-box-body .has-success .form-control-feedback {
  color: #00e676 !important;
}

.register-box-body .has-error .form-control {
  border-color: rgba(255, 82, 82, 0.6) !important;
  background: rgba(255, 82, 82, 0.05) !important;
}

.register-box-body .has-error .form-control-feedback {
  color: #ff5252 !important;
}

/* Status text for Referral ID */
#referral_id_status {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Action Buttons */
.btn-action {
  height: 50px !important;
  border: none !important;
  border-radius: 12px !important;
  font-family: "Inter", sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 20px !important;
}

.btn-primary-cyan {
  background: linear-gradient(135deg, #00d4ff, #0099cc) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3) !important;
}

.btn-primary-cyan:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.45) !important;
}

.btn-success-emerald {
  background: linear-gradient(135deg, #00b894, #00d4a0) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3) !important;
  width: 100% !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
}

.btn-success-emerald:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 184, 148, 0.45) !important;
}

.btn-outline-glass {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  width: 100% !important;
  font-size: 0.9rem !important;
}

.btn-outline-glass:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(0, 212, 255, 0.4) !important;
  color: #00d4ff !important;
  text-decoration: none !important;
}

.btn-action:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* OTP Section Styling */
.otp-input-field {
  letter-spacing: 8px !important;
  font-size: 1.3rem !important;
  font-weight: 700 !important;
  text-align: center !important;
}

.timer-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #00d4ff, #52b788);
  width: 100%;
  transition: width 1s linear;
}

/* Alert Styling */
.alert-danger {
  background: rgba(255, 82, 82, 0.12) !important;
  border: 1px solid rgba(255, 82, 82, 0.3) !important;
  color: #ff5252 !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  margin-bottom: 20px !important;
}

.alert-danger .close {
  color: #ff5252 !important;
  opacity: 0.8 !important;
}

/* Stacked buttons row */
.button-stack {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 576px) {
  body.register-page,
  body.auth-glass-page {
    align-items: flex-start !important;
    padding-top: 45px !important;
    padding-bottom: 30px !important;
  }

  .register-logo img {
    width: 110px !important;
  }

  .register-box-body label[for="captcha_answer"] {
    font-size: 13px !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
  }

  .register-box-body {
    padding: 24px 18px !important;
    border-radius: 20px !important;
  }
}

/* ============================================================================
 * SHARED ADDITIONS
 * The rules below only extend the block above (wider card, dark glass table,
 * success alert, links, loading overlay). They never change its colors, fonts
 * or spacing, so every page stays visually identical.
 * ========================================================================== */

/* --- Wider card (create_member_successful.php details table) --- */
.register-box--wide {
  max-width: 640px !important;
}

/* --- Status headings --- */
.login-box-msg.msg-success {
  color: #00e676 !important;
}
.login-box-msg.msg-error {
  color: #ff5252 !important;
}

/* --- Muted helper text --- */
.glass-muted {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 0.9rem;
  line-height: 1.6;
}

.glass-muted strong {
  color: #ffffff !important;
}

/* --- Dividers --- */
.glass-hr {
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  margin: 22px 0 !important;
}

/* --- Links inside the glass card --- */
.register-box-body a {
  color: #00d4ff !important;
  font-weight: 500;
  transition: color 0.25s ease;
}

.register-box-body a:hover {
  color: #7ae7ff !important;
  text-decoration: none !important;
}

/* Keep action buttons on their own colors (higher specificity on purpose) */
.register-box-body a.btn-action {
  text-decoration: none !important;
}
.register-box-body a.btn-outline-glass {
  color: rgba(255, 255, 255, 0.85) !important;
}
.register-box-body a.btn-outline-glass:hover {
  color: #00d4ff !important;
}
.register-box-body a.btn-success-emerald,
.register-box-body a.btn-primary-cyan {
  color: #ffffff !important;
}

/* --- Success alert (mirrors .alert-danger) --- */
.alert-success {
  background: rgba(0, 230, 118, 0.12) !important;
  border: 1px solid rgba(0, 230, 118, 0.3) !important;
  color: #00e676 !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  margin-bottom: 20px !important;
}

/* --- Dark glass table --- */
.glass-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.glass-table th,
.glass-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-table th {
  width: 42%;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.glass-table td {
  color: #ffffff !important;
}

.glass-table tr:last-child th,
.glass-table tr:last-child td {
  border-bottom: none;
}

.glass-table td strong {
  color: #00d4ff !important;
}

/* --- Loading overlay (index.php) --- */
#loading-screen {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(15, 32, 45, 0.94) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#loading-screen .auth-loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

#loading-screen .auth-loader-brand img {
  width: min(260px, 58vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(53, 211, 153, 0.45));
  animation: metaHealthLogoPulse 1.8s ease-in-out infinite;
}

#loading-screen .auth-loader-typing {
  color: #d9fff0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  border-right: 2px solid #35d399;
  animation:
    metaHealthTyping 2.2s steps(38, end) forwards,
    metaHealthCaret 0.7s step-end infinite;
}

@keyframes metaHealthLogoPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.8;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes metaHealthTyping {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes metaHealthCaret {
  50% {
    border-color: transparent;
  }
}

/* ============================================================================
 * DESKTOP FONT SCALE-UP
 * Screens wider than 576px get slightly larger text (headings, inputs,
 * buttons, labels, helper text). Mobile (<=576px) keeps the original sizes,
 * so nothing changes on phones. All rules sit after the core block and use
 * !important, so they win on desktop only.
 * ========================================================================== */
@media (min-width: 577px) {
  /* Base text (links, alert paragraphs, anything without an explicit size) */
  body.register-page,
  body.auth-glass-page {
    font-size: 15.5px !important;
  }

  /* Headings & badges */
  .login-box-msg {
    font-size: 1.6rem !important;
  } /* was 1.45rem */
  .badge-pill {
    font-size: 0.78rem !important;
  } /* was 0.72rem */

  /* Inputs, selects & the +91 addon */
  .register-box-body .form-control {
    font-size: 1rem !important;
  } /* was 0.95rem */
  .register-box-body .input-group-addon {
    font-size: 1rem !important;
  } /* was 0.95rem */

  /* OTP entry field */
  .otp-input-field {
    font-size: 1.4rem !important;
  } /* was 1.3rem */

  /* Buttons — .btn-success-emerald must come after .btn-action to win */
  .btn-action {
    font-size: 0.95rem !important;
  } /* was 0.88rem */
  .btn-success-emerald {
    font-size: 1.05rem !important;
  } /* was 1rem */

  /* Labels & helper / status text (overrides the inline styles too) */
  .form-group label {
    font-size: 0.85rem !important;
  } /* was 0.8rem */
  #referral_id_status {
    font-size: 0.88rem !important;
  } /* was 0.82rem */
  #otp_send_status,
  #otp_verify_status {
    font-size: 0.88rem !important;
  } /* was 0.82rem */
  #otp_timer {
    font-size: 0.84rem !important;
  } /* was 0.78rem */
  #otp_resend,
  #otp_resend a {
    font-size: 0.88rem !important;
  } /* was 0.82rem */

  /* Result pages (error / success) */
  .glass-muted {
    font-size: 0.95rem !important;
  } /* was 0.9rem */
  .glass-table th,
  .glass-table td {
    font-size: 0.95rem !important;
  } /* was 0.9rem */
}
