/* ==========================================================================
   OwnerDashboard - Authentication UI (Login/Register/ForgotPassword)
   Centralized styles (was previously duplicated in multiple .razor files)
   ========================================================================== */

/* ---- Layout (AuthenticationLayout) ---- */
.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: auth-gradientShift 15s ease infinite;
}

.auth-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.auth-gradient-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  z-index: 1;
}

.auth-shapes {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  animation: auth-float 25s infinite ease-in-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.shape-1 { width: 400px; height: 400px; top: -10%; left: -5%; animation-delay: 0s; }
.shape-2 { width: 300px; height: 300px; top: 50%; right: -5%; animation-delay: 5s; }
.shape-3 { width: 250px; height: 250px; bottom: 10%; left: 10%; animation-delay: 10s; }
.shape-4 { width: 200px; height: 200px; top: 20%; right: 20%; animation-delay: 15s; }

.auth-content {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 28px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  padding: 3.5rem;
  width: 100%;
  max-width: 480px;
  animation: auth-slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

/* ---- Page base ---- */
.auth-page {
  animation: auth-fadeIn 0.5s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: auth-gradientText 3s ease infinite;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 1.2rem;
  line-height: 1.5;
  color: #000;
}

.auth-form { margin-top: 1.5rem; }
.auth-form-group { margin-bottom: 1.5rem; animation: auth-fadeInUp 0.5s ease-out backwards; }
.auth-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; animation: auth-fadeInUp 0.6s ease-out backwards; }
.auth-form-row .auth-form-group { margin-bottom: 0; }

.auth-button-wrapper { margin-top: 2rem; animation: auth-fadeInUp 0.5s ease-out 0.5s backwards; }

/* ---- Alerts ---- */
.auth-alert {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  animation: auth-slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
              0 4px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.auth-alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: auth-shimmer 2.5s infinite;
}

.auth-alert.error {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 202, 202, 0.95) 100%);
  color: #991b1b;
  border-left-color: #ef4444;
  border: 1px solid rgba(252, 165, 165, 0.5);
}
.auth-alert.success {
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.95) 0%, rgba(167, 243, 208, 0.95) 100%);
  color: #065f46;
  border-left-color: #10b981;
  border: 1px solid rgba(110, 231, 183, 0.5);
}
.auth-alert.info {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.95) 0%, rgba(191, 219, 254, 0.95) 100%);
  color: #1e3a8a;
  border-left-color: #3b82f6;
  border: 1px solid rgba(147, 197, 253, 0.5);
}

.auth-alert-icon-wrapper {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}
.auth-alert.error .auth-alert-icon-wrapper { background: rgba(239, 68, 68, 0.15); }
.auth-alert.success .auth-alert-icon-wrapper { background: rgba(16, 185, 129, 0.15); }
.auth-alert.info .auth-alert-icon-wrapper { background: rgba(59, 130, 246, 0.12); }
.auth-alert-icon-wrapper i { font-size: 1.25rem; }

.auth-alert-content { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.auth-alert-content strong { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.9; }
.auth-alert-content span { font-size: 0.9375rem; line-height: 1.5; }

/* ---- Options/Links/Checkbox ---- */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-checkbox-group { margin-bottom: 1.5rem; }

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
  border: 1.5px solid rgba(102, 126, 234, 0.1);
  position: relative;
  overflow: hidden;
}
.auth-checkbox::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.auth-checkbox:hover::before { opacity: 1; }
.auth-checkbox:hover {
  color: #667eea;
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}
.auth-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: #667eea;
  width: 20px;
  height: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.auth-checkbox input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.18);
}
.auth-checkbox input[type="checkbox"]:hover { transform: scale(1.15); box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1); }
.auth-checkbox input[type="checkbox"]:checked { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15); }
.auth-checkbox:has(input[type="checkbox"]:checked) {
  border-color: rgba(102, 126, 234, 0.35);
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.14);
}

.auth-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: inline-block;
}
.auth-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
  border-radius: 2px;
}
.auth-link:hover { color: #764ba2; }
.auth-link:hover::after { width: 100%; }

/* ---- Buttons (AuthButton) ---- */
.auth-button {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  text-align: center;
  letter-spacing: 0.025em;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.auth-button.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 200% 200%;
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4),
              0 2px 8px rgba(102, 126, 234, 0.2);
}
.auth-button.primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5),
              0 4px 12px rgba(102, 126, 234, 0.3);
  background-position: right center;
}
.auth-button.primary:active:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.auth-button.secondary { background: #f3f4f6; color: #374151; }
.auth-button.secondary:hover:not(:disabled) { background: #e5e7eb; }
.auth-button:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-button.loading { pointer-events: none; }
.auth-button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
.auth-button-icon { display: flex; align-items: center; }

/* ---- Divider (AuthDivider) ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 2rem 0;
  position: relative;
}
.auth-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent, #e5e7eb, transparent);
  position: relative;
}
.auth-divider-line::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, #d1d5db, transparent);
  opacity: 0.5;
}
.auth-divider-text {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

/* ---- Social + footer ---- */
.auth-social-login { display: flex; flex-direction: column; gap: 0.875rem; }
.auth-social-button {
  width: 100%;
  padding: 1.125rem 1.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  background: white;
  color: #374151;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.auth-social-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transition: left 0.6s ease;
}
.auth-social-button:hover::before { left: 100%; }
.auth-social-button::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.auth-social-button:hover::after { opacity: 1; }
.auth-social-button:hover {
  border-color: transparent;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
              0 4px 12px rgba(0, 0, 0, 0.1);
}
.auth-social-button:active { transform: translateY(-2px) scale(1); }
.auth-social-button.google { color: #dc2626; }
.auth-social-button.google:hover { border-color: #fca5a5; background: #fef2f2; }
.auth-social-button.facebook { color: #1877f2; }
.auth-social-button.facebook:hover { border-color: #93c5fd; background: #eff6ff; }

.auth-footer {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.9375rem;
  position: relative;
}
.auth-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #667eea, transparent);
  border-radius: 2px;
}
.auth-footer a { font-weight: 600; transition: all 0.3s ease; position: relative; display: inline-block; }
.auth-footer a:hover { transform: translateX(-3px); color: #667eea; }

/* ---- AuthInput ---- */
.auth-input-group { margin-bottom: 1.5rem; }
.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  text-align: right;
}
.auth-input-wrapper { position: relative; }
.auth-input-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  z-index: 1;
  transition: color 0.3s ease;
  font-size: 1.1rem;
  pointer-events: none;
}
.auth-input-wrapper:focus-within .auth-input-icon { color: #667eea; }
.auth-input {
  width: 100%;
  padding: 1rem 1.25rem;
  padding-right: var(--auth-pr, 1.25rem);
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  text-align: right;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.auth-input.with-toggle { padding-left: 3.5rem; }
.auth-input::placeholder { color: #9ca3af; opacity: 0.7; }
.auth-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12),
              0 4px 12px rgba(102, 126, 234, 0.15),
              0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  background: #fafafa;
}
.auth-input:hover:not(:focus):not(:disabled) {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.auth-password-toggle {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 8px;
  z-index: 2;
}
.auth-password-toggle:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-50%) scale(1.1);
}
.auth-password-toggle:active { transform: translateY(-50%) scale(0.95); }
.auth-password-toggle i { font-size: 1.1rem; }
.auth-input-wrapper:focus-within .auth-password-toggle { color: #667eea; }
.auth-input:disabled { background: #f3f4f6; cursor: not-allowed; }
.auth-error-message { display: block; color: #ef4444; font-size: 0.75rem; margin-top: 0.5rem; text-align: right; animation: auth-shake 0.3s ease; }
.auth-helper-text { display: block; color: #6b7280; font-size: 0.75rem; margin-top: 0.5rem; text-align: right; }

/* ---- Animations ---- */
@keyframes auth-float {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(40px, -40px) rotate(90deg) scale(1.1); }
  50% { transform: translate(-30px, 30px) rotate(180deg) scale(0.9); }
  75% { transform: translate(30px, 40px) rotate(270deg) scale(1.05); }
}
@keyframes auth-gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes auth-gradientText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes auth-slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .auth-layout { background-size: 300% 300%; }
  .auth-content { padding: 1.5rem 1rem; align-items: flex-start; padding-top: 2rem; }
  .auth-card { padding: 2rem 1.5rem; border-radius: 20px; max-width: 100%; margin: 0 auto; }
  .auth-card:hover { transform: none; }
  .shape { opacity: 0.06; }
  .shape-1 { width: 250px; height: 250px; }
  .shape-2 { width: 200px; height: 200px; }
  .shape-3 { width: 150px; height: 150px; }
  .shape-4 { width: 120px; height: 120px; }

  /* Mobile-first typography + spacing */
  .auth-title { font-size: 1.85rem; }
  .auth-subtitle { font-size: 1rem; padding: 0 0.5rem; color: #000; }
  .auth-form-row { grid-template-columns: 1fr; }

  .auth-button { padding: 0.875rem 1.25rem; font-size: 0.9375rem; min-height: 50px; border-radius: 12px; }
  .auth-button-spinner { width: 18px; height: 18px; }

  .auth-input {
    padding: 0.875rem 1.125rem;
    padding-right: var(--auth-pr, 1.125rem);
    font-size: 0.9375rem;
    border-radius: 14px;
    min-height: 48px;
  }
  .auth-input:focus { transform: translateY(-1px); }
  .auth-input:hover:not(:focus):not(:disabled) { transform: none; }
  .auth-input-icon { right: 1.125rem; font-size: 1rem; }
  .auth-password-toggle { left: 0.875rem; padding: 0.625rem; min-width: 44px; min-height: 44px; }
  .auth-password-toggle i { font-size: 1rem; }
  .auth-error-message, .auth-helper-text { font-size: 0.8125rem; margin-top: 0.625rem; }

  /* Make the “Remember me / Forgot password” section clean on mobile */
  .auth-options {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .auth-options .auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(229, 231, 235, 0.9);
  }

  .auth-checkbox { padding: 0.95rem 1rem; font-size: 0.8125rem; }
  .auth-checkbox input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; }

  /* Reduce alert density and keep it readable */
  .auth-alert { padding: 1rem 1.25rem; border-radius: 14px; gap: 0.75rem; }
  .auth-alert-icon-wrapper { width: 2.25rem; height: 2.25rem; }
  .auth-alert-icon-wrapper i { font-size: 1.125rem; }
  .auth-alert-content strong { font-size: 0.8125rem; }
  .auth-alert-content span { font-size: 0.875rem; line-height: 1.45; }

  /* Social buttons feel better as “cards” on mobile */
  .auth-social-button {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    min-height: 52px;
    border-radius: 14px;
  }
  .auth-social-button:hover { transform: none; }
}

@media (max-width: 480px) {
  .auth-layout { background-size: 400% 400%; }
  .auth-content { padding: 0.9rem 0.75rem; padding-top: 1.25rem; }
  .auth-card { padding: 1.5rem 1.1rem; border-radius: 16px; }
  .shape { opacity: 0.04; }
  .shape-1 { width: 180px; height: 180px; }
  .shape-2 { width: 150px; height: 150px; }
  .shape-3 { width: 120px; height: 120px; }
  .shape-4 { width: 100px; height: 100px; }

  .auth-title { font-size: 1.6rem; margin-bottom: 0.5rem; }
  .auth-subtitle { font-size: 1rem; padding: 0; color: #000; }

  .auth-footer { margin-top: 2rem; padding-top: 1.5rem; font-size: 0.875rem; }
  .auth-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0.9rem; }
}

@media (hover: none) and (pointer: coarse) {
  .auth-checkbox, .auth-link, .auth-social-button { -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1); tap-highlight-color: rgba(102, 126, 234, 0.1); }
  .auth-checkbox:active, .auth-link:active, .auth-social-button:active { transform: scale(0.98); }
  .auth-checkbox:hover, .auth-social-button:hover, .auth-link:hover { transform: none; }
  .auth-button.primary:hover:not(:disabled) { transform: none; }
  .auth-button.primary:active:not(:disabled) { transform: scale(0.98); }
}


