/* ================================================================
   Petba Auth — Premium Authentication Pages Stylesheet
   Applied to: login, register, OTP verify, forgotten, reset
   ================================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  /* Petba brand palette */
  --petba-primary: #533AD3;
  --petba-primary-light: #8B5CF6;
  --petba-primary-dark: #422fa8;
  --petba-secondary: #8B5CF6;
  --petba-accent: #ef4530;
  --petba-coral: #c73520;

  /* Neutrals */
  --petba-bg: #F8F9FC;
  --petba-surface: #FFFFFF;
  --petba-surface-hover: #F3F4F8;
  --petba-text: #1A1D2B;
  --petba-text-muted: #6B7280;
  --petba-text-light: #9CA3AF;
  --petba-border: #E5E7EB;
  --petba-border-focus: #533AD3;

  /* Shadows */
  --petba-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --petba-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --petba-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --petba-shadow-glow: 0 0 0 4px rgba(83,58,211,0.12);

  /* Transitions */
  --petba-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --petba-duration: 0.3s;

  /* Radii */
  --petba-radius-sm: 8px;
  --petba-radius-md: 12px;
  --petba-radius-lg: 16px;
  --petba-radius-xl: 24px;
}

/* ── Base Auth Layout ── */
.petba-auth-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--petba-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px 20px;
  min-height: calc(100vh - 350px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force footer into normal document flow below auth pages */
footer {
  position: relative !important;
  bottom: auto !important;
  margin-top: 20px;
}

.petba-auth-container {
  display: flex;
  width: 100%;
  max-width: 1000px;
  min-height: 600px;
  background: var(--petba-surface);
  border-radius: var(--petba-radius-xl);
  box-shadow: var(--petba-shadow-lg);
  overflow: hidden;
  margin-bottom: 60px;
  animation: petbaSlideUp 0.6s var(--petba-ease);
}

@keyframes petbaSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Decorative Panel (Left) ── */
.petba-auth-decor {
  flex: 0 0 42%;
  background: linear-gradient(145deg, var(--petba-primary) 0%, var(--petba-accent) 50%, var(--petba-coral) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px;
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.petba-auth-decor::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -40%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.petba-auth-decor::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.petba-decor-icon {
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
  animation: petbaPulse 3s ease-in-out infinite;
}

@keyframes petbaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.petba-decor-icon i {
  font-size: 40px;
  color: #fff;
}

.petba-decor-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.petba-decor-subtitle {
  font-size: 15px;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.6;
  max-width: 280px;
  position: relative;
  z-index: 1;
}

/* Floating shapes for decoration */
.petba-auth-decor .floating-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}
.petba-auth-decor .floating-shape:nth-child(1) { width: 120px; height: 120px; top: 10%; left: -30px; animation: petbaFloat 8s ease-in-out infinite; }
.petba-auth-decor .floating-shape:nth-child(2) { width: 80px; height: 80px; bottom: 15%; right: -20px; animation: petbaFloat 6s ease-in-out infinite 1s; }
.petba-auth-decor .floating-shape:nth-child(3) { width: 50px; height: 50px; top: 60%; left: 15%; animation: petbaFloat 7s ease-in-out infinite 2s; }

@keyframes petbaFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

/* ── Form Panel (Right) ── */
.petba-auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
  overflow-y: auto;
}

.petba-auth-form-panel h1 {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--petba-text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.petba-auth-form-panel .petba-auth-subtitle {
  font-size: 15px;
  color: var(--petba-text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Form Controls ── */
.petba-form-group {
  margin-bottom: 20px;
  position: relative;
}

.petba-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--petba-text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.petba-form-group label .required-star {
  color: var(--petba-accent);
  margin-left: 2px;
}

.petba-form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--petba-border);
  border-radius: var(--petba-radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--petba-text);
  background: var(--petba-surface);
  transition: border-color var(--petba-duration) var(--petba-ease),
              box-shadow var(--petba-duration) var(--petba-ease);
  outline: none;
}

.petba-form-control::placeholder {
  color: var(--petba-text-light);
}

.petba-form-control:focus {
  border-color: var(--petba-border-focus);
  box-shadow: var(--petba-shadow-glow);
}

.petba-form-control.is-invalid {
  border-color: var(--petba-accent);
  box-shadow: 0 0 0 4px rgba(239,69,48,0.1);
}

.petba-form-control.is-invalid ~ .petba-error-text {
  display: block;
}

.petba-error-text {
  display: none;
  font-size: 12px;
  color: var(--petba-accent);
  margin-top: 4px;
  font-weight: 500;
}

/* Password toggle */
.petba-password-wrapper {
  position: relative;
}

.petba-password-wrapper .petba-form-control {
  padding-right: 44px;
}

.petba-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--petba-text-light);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  transition: color var(--petba-duration) var(--petba-ease);
}

.petba-password-toggle:hover {
  color: var(--petba-text-muted);
}

/* ── Buttons ── */
.petba-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--petba-primary) 0%, var(--petba-primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--petba-radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--petba-duration) var(--petba-ease);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.petba-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--petba-primary-light) 0%, var(--petba-primary) 100%);
  opacity: 0;
  transition: opacity var(--petba-duration) var(--petba-ease);
}

.petba-btn-primary:hover::before {
  opacity: 1;
}

.petba-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(83,58,211,0.35);
}

.petba-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(83,58,211,0.25);
}

.petba-btn-primary span {
  position: relative;
  z-index: 1;
}

.petba-btn-primary i {
  position: relative;
  z-index: 1;
  margin-left: 8px;
}

.petba-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.petba-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 24px;
  background: transparent;
  color: var(--petba-text);
  border: 1.5px solid var(--petba-border);
  border-radius: var(--petba-radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--petba-duration) var(--petba-ease);
}

.petba-btn-secondary:hover {
  border-color: var(--petba-primary);
  color: var(--petba-primary);
  background: rgba(83,58,211,0.04);
}

/* ── Links ── */
.petba-link {
  color: var(--petba-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color var(--petba-duration) var(--petba-ease);
}

.petba-link:hover {
  color: var(--petba-primary-dark);
  text-decoration: underline;
}

.petba-auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 14px;
  color: var(--petba-text-muted);
}

.petba-auth-footer a {
  color: var(--petba-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--petba-duration) var(--petba-ease);
}

.petba-auth-footer a:hover {
  color: var(--petba-primary-dark);
}

.petba-forgot-link {
  display: block;
  text-align: right;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

/* ── Divider ── */
.petba-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--petba-text-light);
  font-size: 13px;
}

.petba-divider::before,
.petba-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--petba-border);
}

.petba-divider span {
  padding: 0 16px;
}

/* ── Alerts ── */
.petba-alert {
  padding: 12px 16px;
  border-radius: var(--petba-radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: petbaShake 0.4s var(--petba-ease);
}

.petba-alert-error {
  background: rgba(239,69,48,0.08);
  color: var(--petba-accent);
  border: 1px solid rgba(239,69,48,0.15);
}

.petba-alert-success {
  background: rgba(16,185,129,0.08);
  color: #059669;
  border: 1px solid rgba(16,185,129,0.15);
}

@keyframes petbaShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* ── OTP Input ── */
.petba-otp-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 32px 0;
}

.petba-otp-input {
  width: 52px;
  height: 60px;
  border: 2px solid var(--petba-border);
  border-radius: var(--petba-radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--petba-text);
  text-align: center;
  outline: none;
  transition: all var(--petba-duration) var(--petba-ease);
  background: var(--petba-surface);
  caret-color: var(--petba-primary);
}

.petba-otp-input:focus {
  border-color: var(--petba-primary);
  box-shadow: var(--petba-shadow-glow);
  transform: scale(1.05);
}

.petba-otp-input.filled {
  border-color: var(--petba-primary);
  background: rgba(83,58,211,0.04);
}

.petba-otp-input.error {
  border-color: var(--petba-accent);
  box-shadow: 0 0 0 4px rgba(239,69,48,0.1);
  animation: petbaShake 0.4s var(--petba-ease);
}

/* ── Countdown Timer ── */
.petba-countdown {
  text-align: center;
  margin: 16px 0 24px;
  font-size: 14px;
  color: var(--petba-text-muted);
}

.petba-countdown-timer {
  font-weight: 700;
  color: var(--petba-primary);
  font-variant-numeric: tabular-nums;
}

.petba-resend-btn {
  background: none;
  border: none;
  color: var(--petba-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--petba-duration) var(--petba-ease);
}

.petba-resend-btn:hover:not(:disabled) {
  background: rgba(83,58,211,0.08);
}

.petba-resend-btn:disabled {
  color: var(--petba-text-light);
  cursor: not-allowed;
}

/* ── Email Mask Display ── */
.petba-email-display {
  text-align: center;
  margin-bottom: 8px;
}

.petba-email-display .email {
  font-weight: 600;
  color: var(--petba-text);
  background: rgba(83,58,211,0.06);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  font-size: 14px;
}

/* ── Password Strength ── */
.petba-password-strength {
  margin-top: 8px;
}

.petba-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--petba-border);
  overflow: hidden;
  margin-bottom: 6px;
}

.petba-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s var(--petba-ease), background-color 0.4s var(--petba-ease);
  width: 0;
}

.petba-strength-fill[data-strength="0"] { width: 0; background: transparent; }
.petba-strength-fill[data-strength="1"] { width: 25%; background: #EF4444; }
.petba-strength-fill[data-strength="2"] { width: 50%; background: #F59E0B; }
.petba-strength-fill[data-strength="3"] { width: 75%; background: #10B981; }
.petba-strength-fill[data-strength="4"] { width: 100%; background: #059669; }

.petba-strength-text {
  font-size: 11px;
  font-weight: 500;
}

.petba-strength-text[data-strength="1"] { color: #EF4444; }
.petba-strength-text[data-strength="2"] { color: #F59E0B; }
.petba-strength-text[data-strength="3"] { color: #10B981; }
.petba-strength-text[data-strength="4"] { color: #059669; }

/* ── Custom Field Styling ── */
.petba-auth-form-panel .custom-field {
  margin-bottom: 20px;
}

.petba-auth-form-panel .custom-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--petba-text);
}

.petba-auth-form-panel .custom-field .form-control,
.petba-auth-form-panel .custom-field .form-select {
  padding: 12px 16px;
  border: 1.5px solid var(--petba-border);
  border-radius: var(--petba-radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color var(--petba-duration) var(--petba-ease),
              box-shadow var(--petba-duration) var(--petba-ease);
}

.petba-auth-form-panel .custom-field .form-control:focus,
.petba-auth-form-panel .custom-field .form-select:focus {
  border-color: var(--petba-border-focus);
  box-shadow: var(--petba-shadow-glow);
}

/* ── Newsletter & Agree ── */
.petba-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--petba-text-muted);
}

.petba-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--petba-primary);
  border-radius: 4px;
  cursor: pointer;
}

.petba-checkbox-row a {
  color: var(--petba-primary);
  font-weight: 500;
}

/* ── Loading Spinner ── */
.petba-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: petbaSpin 0.7s linear infinite;
  margin-right: 8px;
}

@keyframes petbaSpin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .petba-auth-page {
    padding: 0;
    align-items: flex-start;
  }

  .petba-auth-container {
    flex-direction: column;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .petba-auth-decor {
    flex: 0 0 auto;
    padding: 32px 24px 28px;
    min-height: auto;
  }

  .petba-decor-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }

  .petba-decor-icon i {
    font-size: 28px;
  }

  .petba-decor-title {
    font-size: 20px;
  }

  .petba-decor-subtitle {
    font-size: 13px;
  }

  .petba-auth-form-panel {
    padding: 28px 24px 40px;
  }

  .petba-auth-form-panel h1 {
    font-size: 24px;
  }

  .petba-otp-container {
    gap: 8px;
  }

  .petba-otp-input {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .petba-auth-form-panel {
    padding: 24px 18px 32px;
  }

  .petba-otp-input {
    width: 40px;
    height: 48px;
    font-size: 18px;
  }

  /* Shrink the decorative panel further so it doesn't push the form
     far down the page on very small phones */
  .petba-auth-container {
    min-height: auto;
  }

  .petba-auth-decor {
    padding: 20px 20px 18px;
  }

  .petba-decor-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
  }

  .petba-decor-icon i {
    font-size: 22px;
  }

  .petba-decor-title {
    font-size: 17px;
    margin-bottom: 2px;
  }

  .petba-decor-subtitle {
    display: none;
  }

  .petba-auth-decor .floating-shape {
    display: none;
  }
}

/* ── Form inline rows for register (first/last name) ── */
.petba-form-row {
  display: flex;
  gap: 16px;
}

.petba-form-row .petba-form-group {
  flex: 1;
}

@media (max-width: 480px) {
  .petba-form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ── Captcha container ── */
.petba-captcha-container {
  margin-bottom: 20px;
}

/* ── Hide breadcrumbs on auth pages ── */
.petba-auth-page .breadcrumb {
  display: none;
}

/* ── Hide stock OpenCart layout wrappers on auth pages ── */
.petba-auth-page #content {
  padding-bottom: 0;
}

/* ── Google Auth Button & Divider ── */
.petba-google-auth-wrapper {
  margin-top: 20px;
}

.petba-auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--petba-text-light);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.petba-auth-divider::before,
.petba-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--petba-border);
}

.petba-auth-divider span {
  padding: 0 14px;
  color: var(--petba-text-muted);
}

.petba-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  background: var(--petba-surface);
  color: var(--petba-text);
  border: 1.5px solid var(--petba-border);
  border-radius: var(--petba-radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--petba-duration) var(--petba-ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.petba-btn-google:hover {
  background: var(--petba-surface-hover);
  border-color: #CBD5E1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.petba-btn-google:active {
  transform: translateY(0);
  box-shadow: none;
}

.petba-btn-google:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.petba-google-icon {
  margin-right: 10px;
  flex-shrink: 0;
}

