/* ==========================================================================
   Beautifly Ecosystem — Unified Login System
   Shared across Delivery App, Shop Admin Panel, and Standalone Portal.
   ========================================================================== */

:root {
  --eco-primary: #C9005D;
  --eco-primary-hover: #A1004A;
  --eco-primary-light: #fdf2f8;
  --eco-accent: #C9005D;
  --eco-accent-hover: #A1004A;
  --eco-text-main: #0f172a;
  --eco-text-muted: #64748b;
  --eco-border: rgba(226, 232, 240, 0.8);
  --eco-card-bg: rgba(255, 255, 255, 0.94);
  --eco-glass-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

[hidden],
.eco-login-viewport [hidden],
.eco-login-card [hidden],
.eco-form[hidden],
.eco-error-banner[hidden],
.eco-portal-launcher[hidden] {
  display: none !important;
}

body.is-standalone-login {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Ambient Animated Background
   -------------------------------------------------------------------------- */
.eco-login-viewport {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: linear-gradient(135deg, #fdf4f8 0%, #f1f5f9 50%, #eff6ff 100%);
  overflow-x: hidden;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.eco-login-viewport *,
.eco-login-viewport *::before,
.eco-login-viewport *::after {
  box-sizing: border-box;
}

.eco-bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.eco-glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  will-change: transform;
}

.eco-glow-1 {
  top: -10%;
  left: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.6) 0%, rgba(219, 39, 119, 0.1) 70%);
  animation: ecoFloat1 18s ease-in-out infinite alternate;
}

.eco-glow-2 {
  bottom: -15%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.55) 0%, rgba(99, 102, 241, 0.1) 70%);
  animation: ecoFloat2 22s ease-in-out infinite alternate;
}

.eco-glow-3 {
  top: 40%;
  right: 35%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.35) 0%, rgba(249, 115, 22, 0.05) 70%);
  animation: ecoFloat3 15s ease-in-out infinite alternate;
}

@keyframes ecoFloat1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-30px, 80px) scale(0.95); }
}

@keyframes ecoFloat2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-70px, -50px) scale(1.15); }
  100% { transform: translate(40px, -30px) scale(0.9); }
}

@keyframes ecoFloat3 {
  0%   { transform: translate(0, 0) scale(0.9); }
  50%  { transform: translate(-40px, 60px) scale(1.1); }
  100% { transform: translate(50px, -20px) scale(1); }
}

/* --------------------------------------------------------------------------
   Login Container & Glass Card
   -------------------------------------------------------------------------- */
.eco-login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--eco-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--eco-border);
  border-radius: 22px;
  box-shadow: var(--eco-glass-shadow);
  padding: 28px 22px 22px;
  margin: auto;
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  animation: ecoCardPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes ecoCardPop {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Header & Animated Greetings
   -------------------------------------------------------------------------- */
.eco-header {
  text-align: center;
  margin-bottom: 18px;
}

.eco-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #831843 0%, #be185d 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(131, 24, 67, 0.28), 0 0 0 3.5px rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
  position: relative;
}

.eco-brand-badge::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 21px;
  border: 2px solid rgba(219, 39, 119, 0.35);
  animation: ecoPulseRing 3s ease-in-out infinite;
}

@keyframes ecoPulseRing {
  0%, 100% { transform: scale(0.96); opacity: 0.4; }
  50% { transform: scale(1.06); opacity: 0.9; }
}

.eco-title {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--eco-text-main);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #0f172a 0%, #831843 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  word-wrap: break-word;
}

.eco-greeting-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 3px 8px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  margin: 8px auto 0;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
}

.eco-greeting-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  text-align: center;
  transition: opacity 0.35s ease, transform 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.eco-greeting-text.is-switching {
  opacity: 0;
  transform: translateY(-6px);
}

.eco-greeting-icon {
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   Segmented Auth Tabs
   -------------------------------------------------------------------------- */
.eco-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.eco-tab-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eco-tab-btn:hover {
  color: var(--eco-text-main);
}

.eco-tab-btn.is-active {
  background: #ffffff;
  color: var(--eco-primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   Forms & Controls
   -------------------------------------------------------------------------- */
.eco-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eco-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.eco-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eco-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.eco-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.eco-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  font-size: 14px;
  font-weight: 500;
  color: var(--eco-text-main);
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.eco-input:focus {
  border-color: var(--eco-primary);
  box-shadow: 0 0 0 3.5px rgba(131, 24, 67, 0.12);
}

.eco-input-passcode {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  padding: 0 14px;
}

.eco-pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-pass-toggle:hover {
  color: #475569;
}

/* --------------------------------------------------------------------------
   Buttons & Feedback
   -------------------------------------------------------------------------- */
.eco-btn-submit {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #831843 0%, #9d174d 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(131, 24, 67, 0.3);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.eco-btn-submit:hover {
  background: linear-gradient(135deg, #9d174d 0%, #be185d 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(131, 24, 67, 0.38);
}

.eco-btn-submit:active {
  transform: translateY(0);
}

.eco-btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.eco-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  animation: ecoShake 0.4s ease;
}

.eco-success-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.eco-form-switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--eco-text-muted);
  flex-wrap: wrap;
}

.eco-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #831843;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.eco-link-btn:hover {
  color: #9d174d;
}

.eco-input-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  display: block;
  text-align: left;
}

.eco-pwd-rules-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.eco-pwd-rule {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.eco-rule-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.eco-pwd-rule.is-valid {
  color: #059669;
  font-weight: 600;
}

.eco-pwd-rule.is-valid .eco-rule-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

@keyframes ecoShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* --------------------------------------------------------------------------
   Post-Login Ecosystem Hub (Launcher)
   -------------------------------------------------------------------------- */
.eco-portal-launcher {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eco-user-profile-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
  text-align: left;
}

.eco-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5A42FC 0%, #4338ca 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-user-meta h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--eco-text-main);
  margin: 0;
}

.eco-user-meta p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}

.eco-app-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.eco-app-tile:hover {
  border-color: var(--eco-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.eco-app-tile.is-delivery:hover {
  border-color: #831843;
}

.eco-app-tile.is-admin:hover {
  border-color: #5A42FC;
}

.eco-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.eco-tile-icon.is-delivery {
  background: #fdf2f8;
  color: #be185d;
}

.eco-tile-icon.is-admin {
  background: #eef2ff;
  color: #4f46e5;
}

.eco-tile-info {
  flex: 1;
}

.eco-tile-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--eco-text-main);
  margin: 0 0 2px;
}

.eco-tile-desc {
  font-size: 12px;
  color: var(--eco-text-muted);
  margin: 0;
}

.eco-tile-arrow {
  color: #94a3b8;
  font-size: 18px;
  font-weight: 700;
}

.eco-footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.eco-footer-note strong {
  color: #64748b;
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .eco-login-viewport {
    padding: 12px;
  }
  .eco-login-card {
    padding: 24px 18px 20px;
    border-radius: 18px;
    max-width: 100%;
  }
  .eco-title {
    font-size: 18px;
  }
  .eco-greeting-box {
    max-width: 100%;
    padding: 3px 8px;
    min-height: 34px;
  }
  .eco-greeting-text {
    font-size: 11.5px;
  }
  .eco-brand-badge {
    width: 52px;
    height: 52px;
    font-size: 24px;
    border-radius: 16px;
    margin-bottom: 10px;
  }
}

/* --------------------------------------------------------------------------
   Avatar Photo & Interactive 500x500 Cropper System
   -------------------------------------------------------------------------- */
.sa-user-avatar {
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  background: #541dff;
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sa-user-avatar.has-photo {
  background: transparent !important;
}
.sa-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Crop Modal */
.eco-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
.eco-crop-card {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: ecoCropPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ecoCropPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.eco-crop-header {
  padding: 15px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eco-crop-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eco-crop-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.eco-crop-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.eco-crop-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.eco-crop-canvas-wrap {
  width: 270px;
  height: 270px;
  position: relative;
  background: #090d16;
  border-radius: 14px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.eco-crop-canvas-wrap:active {
  cursor: grabbing;
}
.eco-crop-canvas-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.eco-crop-guide-circle {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.eco-crop-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.eco-crop-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.eco-crop-btn-sm {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.eco-crop-btn-sm:hover {
  background: #e2e8f0;
}
.eco-crop-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  accent-color: #be123c;
  cursor: pointer;
}
.eco-crop-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.eco-crop-btn-cancel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.eco-crop-btn-save {
  background: linear-gradient(135deg, #be123c 0%, #831843 100%);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(190, 18, 60, 0.25);
  transition: all 0.15s ease;
}
.eco-crop-btn-save:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.eco-crop-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* --------------------------------------------------------------------------
   Profile Details & Change Password Modals
   -------------------------------------------------------------------------- */
.eco-privilege-badge {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  line-height: 1.35;
}
.eco-modal-body-form {
  width: 100%;
  box-sizing: border-box;
}
.eco-modal-body-form .eco-form-group {
  margin-bottom: 12px;
}
.eco-modal-body-form .eco-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}
.eco-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.eco-input-wrapper .eco-input {
  width: 100%;
  padding-right: 38px;
  box-sizing: border-box;
}
.eco-input-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eco-input-eye-btn:hover {
  color: #0f172a;
}
.eco-pass-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 10px;
  margin-top: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #64748b;
}
.eco-chk-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.eco-chk-item.is-valid {
  color: #059669;
  font-weight: 600;
}
.eco-chk-item.is-valid svg {
  stroke: #059669;
}

