/* ======================================================
   REGISTER PAGE CSS
   File: frontend/authCSS/register.css
   Purpose:
   - Compact register page like login page
   - Smaller OTP section
   - Supports resend OTP cooldown
====================================================== */

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.48)),
    url("../images/background.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: #0f172a;
  position: relative;
}

.register-container {
  width: min(1060px, 94vw);
  display: grid;
  grid-template-columns: 0.9fr 0.95fr;
  gap: 22px;
  align-items: center;
}

/* ======================================================
   LEFT SHOWCASE PANEL
====================================================== */

.register-showcase {
  min-height: 500px;
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.88),
      rgba(15, 118, 110, 0.7),
      rgba(20, 184, 166, 0.58));
  color: white;
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.register-showcase::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(8px);
}

.register-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.register-showcase h1 {
  font-size: 2.15rem;
  line-height: 1.12;
  margin: 0 0 13px;
  position: relative;
  z-index: 1;
  max-width: 455px;
}

.register-showcase p {
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 455px;
  opacity: 0.96;
  margin: 0;
  position: relative;
  z-index: 1;
}

.register-points {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.register-point {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  padding: 12px 14px;
}

.register-point strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.register-point span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.32;
  opacity: 0.95;
}

/* ======================================================
   REGISTER CARD AND FORM
====================================================== */

.register-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  padding: 26px 26px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  width: 100%;
  max-width: 500px;
  justify-self: start;
}

.register-card h2 {
  color: #0f172a;
  font-size: 1.75rem;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}

.register-subtext {
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.5;
  font-size: 0.9rem;
}

.register-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 13px;
}

.register-form-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.register-form-group.full-width {
  grid-column: 1 / -1;
}

.register-form-group label {
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.register-form-group input,
.register-form-group textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #b9c9d6;
  border-radius: 14px;
  outline: none;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
}

.register-form-group textarea {
  min-height: 70px;
  resize: vertical;
}

.register-form-group input:focus,
.register-form-group textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

/* ======================================================
   PASSWORD FIELD
====================================================== */

.password-field {
  position: relative;
  width: 100%;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.password-toggle:hover {
  background: rgba(20, 184, 166, 0.22);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.field-help {
  margin-top: 4px;
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.25;
}

/* ======================================================
   OTP VERIFICATION BOX - COMPACT
====================================================== */

.otp-box {
  display: none;
  margin-top: 14px;
  background: #f8fafc;
  border: 1px solid #dbe7ef;
  border-radius: 16px;
  padding: 14px;
}

.otp-box.show {
  display: block;
}

.otp-box h3 {
  margin: 0 0 5px;
  color: #0f172a;
  font-size: 1rem;
}

.otp-box p {
  margin: 0 0 10px;
  color: #64748b;
  line-height: 1.4;
  font-size: 0.84rem;
}

.otp-box .register-form-group label {
  font-size: 0.84rem;
}

.otp-box input {
  min-height: 42px;
  padding: 10px 13px;
}

.otp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

/* ======================================================
   BUTTONS AND MESSAGES
====================================================== */

.register-submit,
.otp-btn,
.otp-secondary-btn {
  width: 100%;
  padding: 12px 15px;
  border: none;
  border-radius: 15px;
  font-weight: 900;
  font-size: 0.96rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.register-submit,
.otp-btn {
  background: linear-gradient(135deg, #14b8a6, #0f9488);
  color: white;
  box-shadow: 0 14px 28px rgba(20, 184, 166, 0.22);
}

.otp-secondary-btn {
  background: #e2e8f0;
  color: #0f172a;
}

.otp-secondary-btn:disabled,
.otp-btn:disabled,
.register-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none !important;
}

.register-submit {
  margin-top: 14px;
}

.register-submit:hover,
.otp-btn:hover,
.otp-secondary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.auth-link {
  margin-top: 12px;
  text-align: center;
  color: #475569;
  line-height: 1.4;
  font-size: 0.88rem;
}

.auth-link a {
  color: #0f9488;
  text-decoration: none;
  font-weight: 900;
}

.message {
  margin-top: 10px;
  text-align: center;
  font-weight: 800;
  line-height: 1.4;
  font-size: 0.9rem;
}

/* ======================================================
   RESPONSIVE DESIGN
====================================================== */

@media (max-width: 950px) {
  .register-container {
    max-width: 500px;
    grid-template-columns: 1fr;
  }

  .register-showcase {
    display: none;
  }

  .register-card {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 700px) {
  .auth-page {
    padding: 18px 12px;
    align-items: flex-start;
  }

  .register-form-grid {
    grid-template-columns: 1fr;
  }

  .register-card {
    border-radius: 24px;
    padding: 22px 16px;
  }

  .register-card h2 {
    font-size: 1.55rem;
  }

  .register-subtext {
    font-size: 0.86rem;
  }

  .otp-actions {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   EXTRA COMPACT REGISTER PAGE OVERRIDE
====================================================== */

.register-container {
  width: min(980px, 92vw);
  grid-template-columns: 0.85fr 0.9fr;
  gap: 18px;
}

.register-showcase {
  min-height: 455px;
  padding: 28px 26px;
  border-radius: 26px;
}

.register-showcase h1 {
  font-size: 1.95rem;
  max-width: 420px;
}

.register-showcase p {
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 420px;
}

.register-points {
  gap: 8px;
  margin-top: 16px;
}

.register-point {
  padding: 10px 12px;
  border-radius: 14px;
}

.register-point strong {
  font-size: 0.86rem;
}

.register-point span {
  font-size: 0.8rem;
}

.register-card {
  max-width: 460px;
  padding: 22px 22px;
  border-radius: 26px;
}

.register-card h2 {
  font-size: 1.55rem;
  margin-bottom: 5px;
}

.register-subtext {
  font-size: 0.84rem;
  margin-bottom: 12px;
  line-height: 1.45;
}

.register-form-grid {
  gap: 9px 11px;
}

.register-form-group label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.register-form-group input,
.register-form-group textarea {
  min-height: 39px;
  padding: 9px 12px;
  border-radius: 13px;
  font-size: 0.84rem;
}

.register-form-group textarea {
  min-height: 58px;
}

.password-toggle {
  width: 30px;
  height: 30px;
}

.password-toggle svg {
  width: 15px;
  height: 15px;
}

.field-help {
  font-size: 0.7rem;
}

.register-submit,
.otp-btn,
.otp-secondary-btn {
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 0.88rem;
}

.register-submit {
  margin-top: 11px;
}

.otp-box {
  margin-top: 11px;
  padding: 12px;
  border-radius: 14px;
}

.otp-box h3 {
  font-size: 0.92rem;
}

.otp-box p {
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.otp-box input {
  min-height: 38px;
}

.otp-actions {
  gap: 8px;
  margin-top: 8px;
}

.auth-link {
  margin-top: 10px;
  font-size: 0.82rem;
}

.message {
  margin-top: 8px;
  font-size: 0.82rem;
}

@media (max-width: 950px) {
  .register-container {
    max-width: 460px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {}

/* ======================================================
   BACK TO LANDING PAGE LINK
   Purpose:
   - Small blurred button that returns users to the landing page
   - Uses a soft background so the text is readable but not distracting
====================================================== */

.back-landing-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 100;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  transition: 0.2s ease;
}

.back-landing-btn:hover {
  background: rgba(15, 23, 42, 0.42);
  color: #ffffff;
}

/* ======================================================
   BACK TO LANDING PAGE LINK - MOBILE
   Purpose:
   - Prevents the button from covering the mobile form
   - Places it neatly above the card instead of fixed overlay
====================================================== */

@media (max-width: 768px) {
  .back-landing-btn {
    position: static;
    display: inline-flex;
    width: fit-content;
    margin: 0 auto 10px 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.32);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

/* ======================================================
   FINAL MOBILE FIX FOR AUTH PAGES
====================================================== */

@media (max-width: 768px) {
  .auth-page {
    align-items: center;
    padding-top: 54px;
  }

  .auth-showcase,
  .register-showcase {
    display: none !important;
  }

  .auth-container,
  .register-container {
    grid-template-columns: 1fr !important;
    max-width: 430px;
  }

  .back-landing-btn {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 9999 !important;
    display: inline-flex !important;
    width: auto !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.38) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* ======================================================
   PREMIUM PASSWORD UI
   Purpose:
   - Upgrades register password field into a premium live validator
   - Adds strength bar, requirement checks, and match status
====================================================== */

.password-premium-group {
  padding: 13px;
  border: 1px solid #dbe7ef;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
}

.password-premium-group > label {
  display: none;
}

.premium-password-field {
  position: relative;
  width: 100%;
  margin-top: 4px;
}

.premium-password-field input {
  min-height: 52px !important;
  padding: 13px 52px 12px 15px !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  font-size: 0.94rem !important;
  transition: 0.2s ease;
}

.premium-password-field input:focus {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12) !important;
}

.premium-password-field.valid input {
  border-color: #22c55e !important;
}

.premium-password-field.partial input {
  border-color: #f59e0b !important;
}

.premium-password-field.invalid input {
  border-color: #ef4444 !important;
}

.premium-floating-label {
  position: absolute;
  top: -9px;
  left: 14px;
  z-index: 2;
  padding: 0 7px;
  background: #f8fafc;
  color: #16a34a;
  font-size: 0.78rem;
  font-weight: 900;
  pointer-events: none;
}

.premium-password-field .password-toggle {
  right: 11px;
  width: 34px;
  height: 34px;
  background: transparent;
  color: #64748b;
}

.premium-password-field .password-toggle:hover {
  background: #f1f5f9;
  color: #0f766e;
}

/* ======================================================
   PASSWORD STRENGTH BAR
====================================================== */

.password-strength {
  margin-top: 10px;
}

.password-strength-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

.password-strength-header strong {
  color: #64748b;
  font-weight: 950;
}

.password-strength-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.password-strength-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #cbd5e1;
  transition: width 0.25s ease, background 0.25s ease;
}

.password-strength[data-strength="weak"] .password-strength-bar {
  background: #ef4444;
}

.password-strength[data-strength="fair"] .password-strength-bar {
  background: #f59e0b;
}

.password-strength[data-strength="good"] .password-strength-bar {
  background: #0ea5e9;
}

.password-strength[data-strength="strong"] .password-strength-bar {
  background: #22c55e;
}

.password-strength[data-strength="weak"] .password-strength-header strong {
  color: #dc2626;
}

.password-strength[data-strength="fair"] .password-strength-header strong {
  color: #d97706;
}

.password-strength[data-strength="good"] .password-strength-header strong {
  color: #0284c7;
}

.password-strength[data-strength="strong"] .password-strength-header strong {
  color: #16a34a;
}

/* ======================================================
   PASSWORD REQUIREMENT INDICATORS
====================================================== */

.password-requirements {
  margin-top: 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.password-requirement {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 850;
  transition: color 0.2s ease;
}

.requirement-icon {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: transparent;
  font-size: 0.66rem;
  font-weight: 950;
  transition: 0.2s ease;
}

.password-requirement.met {
  color: #16a34a;
}

.password-requirement.met .requirement-icon {
  background: #22c55e;
  color: #ffffff;
}

/* ======================================================
   CONFIRM PASSWORD MATCH STATUS
====================================================== */

.password-match-status {
  min-height: 18px;
  margin-top: 5px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.password-match-status.match {
  color: #16a34a;
}

.password-match-status.no-match {
  color: #dc2626;
}

.confirm-password-group .password-field.match input {
  border-color: #22c55e;
}

.confirm-password-group .password-field.no-match input {
  border-color: #ef4444;
}

/* ======================================================
   PREMIUM PASSWORD MOBILE LAYOUT
====================================================== */

@media (max-width: 480px) {
  .password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .password-requirement:last-child {
    grid-column: 1 / -1;
  }
}


/* ======================================================
   COMPACT PREMIUM PASSWORD UI
   Purpose:
   - Keeps the same premium password design
   - Reduces unnecessary vertical space
   - Makes strength meter and requirements more compact
====================================================== */

.password-premium-group {
  padding: 9px 11px;
  border-radius: 16px;
}

.premium-password-field {
  margin-top: 2px;
}

.premium-password-field input {
  min-height: 44px;
  padding: 10px 46px 9px 14px !important;
  border-radius: 16px;
  font-size: 0.88rem;
}

.premium-floating-label {
  top: -8px;
  left: 12px;
  padding: 0 6px;
  font-size: 0.72rem;
}

.premium-password-field .password-toggle {
  right: 9px;
  width: 30px;
  height: 30px;
}

.premium-password-field .password-toggle svg {
  width: 14px;
  height: 14px;
}

.password-strength {
  margin-top: 6px;
}

.password-strength-header {
  margin-bottom: 4px;
  font-size: 0.71rem;
  line-height: 1.2;
}

.password-strength-track {
  height: 4px;
}

.password-requirements {
  margin-top: 6px;
  gap: 5px 8px;
}

.password-requirement {
  gap: 4px;
  font-size: 0.66rem;
  line-height: 1.1;
}

.requirement-icon {
  width: 15px;
  height: 15px;
  font-size: 0.58rem;
}

/* ======================================================
   MOBILE COMPACT PASSWORD UI
====================================================== */

@media (max-width: 480px) {
  .password-premium-group {
    padding: 8px 9px;
  }

  .password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 7px;
  }

  .password-requirement:last-child {
    grid-column: auto;
  }
}


/* ======================================================
   EXTRA COMPACT PREMIUM PASSWORD UI
   Purpose:
   - Further reduce height and spacing
   - Keep same layout and visual design
====================================================== */

.password-premium-group {
  padding: 7px 9px;
  border-radius: 14px;
}

.premium-password-field {
  margin-top: 1px;
}

.premium-password-field input {
  min-height: 40px;
  padding: 8px 42px 8px 12px !important;
  border-radius: 14px;
  font-size: 0.84rem;
}

.premium-floating-label {
  top: -7px;
  left: 10px;
  padding: 0 5px;
  font-size: 0.68rem;
}

.premium-password-field .password-toggle {
  right: 7px;
  width: 27px;
  height: 27px;
}

.premium-password-field .password-toggle svg {
  width: 13px;
  height: 13px;
}

.password-strength {
  margin-top: 4px;
}

.password-strength-header {
  margin-bottom: 3px;
  font-size: 0.67rem;
  line-height: 1.05;
}

.password-strength-track {
  height: 3px;
}

.password-requirements {
  margin-top: 4px;
  gap: 4px 6px;
}

.password-requirement {
  gap: 3px;
  font-size: 0.61rem;
  line-height: 1;
}

.requirement-icon {
  width: 13px;
  height: 13px;
  font-size: 0.52rem;
}

/* ======================================================
   EXTRA COMPACT MOBILE TUNING
====================================================== */

@media (max-width: 480px) {
  .password-premium-group {
    padding: 6px 8px;
  }

  .premium-password-field input {
    min-height: 39px;
  }

  .password-requirements {
    gap: 4px 5px;
  }

  .password-requirement {
    font-size: 0.59rem;
  }
}
