/* ============================================================
   El Gouna Sign-In — Glass Morphism, Light Mode, Premium
   ============================================================ */

:root {
  --eg-lagoon: #1F4F3A;
  --eg-lagoon-50: #E8F0EC;
  --eg-lagoon-600: #1A4232;
  --eg-lagoon-700: #133024;
  --eg-sand-100: #F5F1E8;
  --eg-sand-200: #EBE2D2;
  --eg-coral: #A88B45;
  --eg-gold: #A88B45;
  --eg-text: #1A2A22;
  --eg-text-strong: #0F1B14;
  --eg-text-muted: #6B7B72;

  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 30px 80px rgba(15, 50, 36, 0.18), 0 8px 24px rgba(15, 50, 36, 0.10);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;

  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: var(--font-body);
  color: var(--eg-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(circle at 8% 18%, rgba(31, 79, 58, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 92% 14%, rgba(201, 169, 97, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(79, 130, 100, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 14% 88%, rgba(184, 84, 71, 0.14) 0%, transparent 40%),
    linear-gradient(135deg, #F5F1E8 0%, #E8F0EC 50%, #F0F4F8 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ============================================================
   Page layout
   ============================================================ */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Animated coastal background orbs
   ============================================================ */

.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: orb-float 18s ease-in-out infinite;
}
.bg-orb-1 { top: -10%; left: -8%; width: 480px; height: 480px;
            background: radial-gradient(circle, #4F8264 0%, transparent 70%); animation-delay: 0s; }
.bg-orb-2 { top: 60%; right: -10%; width: 540px; height: 540px;
            background: radial-gradient(circle, #A88B45 0%, transparent 70%); animation-delay: 4s; }
.bg-orb-3 { bottom: -12%; left: 20%; width: 420px; height: 420px;
            background: radial-gradient(circle, #A88B45 0%, transparent 70%); animation-delay: 8s; }
.bg-orb-4 { top: 30%; left: 40%; width: 360px; height: 360px;
            background: radial-gradient(circle, #1F4F3A 0%, transparent 70%); animation-delay: 12s; }

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ============================================================
   Login card
   ============================================================ */

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  padding: 2.5rem 2.25rem 2rem;
  position: relative;
  z-index: 2;
  animation: card-rise 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 60%);
  pointer-events: none;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-head { text-align: center; margin-bottom: 1.75rem; }

.logo-wrap {
  display: flex; justify-content: center;
  margin-bottom: 1.25rem;
}
.brand-logo {
  height: 64px;
  width: auto;
  filter: drop-shadow(0 6px 16px rgba(15, 50, 36, 0.22));
  animation: logo-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes logo-pop {
  from { opacity: 0; transform: scale(0.85) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--eg-text-strong);
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0;
  color: var(--eg-text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ============================================================
   Form
   ============================================================ */

.form { display: flex; flex-direction: column; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--eg-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 0.15rem;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 79, 58, 0.14);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.input-shell:focus-within {
  background: white;
  border-color: var(--eg-lagoon);
  box-shadow: 0 0 0 4px rgba(31, 79, 58, 0.12);
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--eg-text-muted);
  font-size: 0.95rem;
  transition: var(--transition);
}
.input-shell:focus-within .input-icon { color: var(--eg-lagoon); }

.input-shell input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.85rem 0.95rem 0.85rem 42px;
  font-family: var(--font-body);
  font-size: 0.97rem;
  color: var(--eg-text);
  border-radius: var(--radius-md);
}
.input-shell input::placeholder { color: #B0BAC4; font-weight: 400; }

.toggle-password {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--eg-text-muted);
  padding: 0 14px;
  height: 100%;
  transition: var(--transition);
}
.toggle-password:hover { color: var(--eg-lagoon); }

/* ============================================================
   Remember-me row
   ============================================================ */

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.25rem 0 0.5rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--eg-text-muted);
  cursor: pointer;
  user-select: none;
}
.check input { display: none; }
.check-box {
  width: 18px; height: 18px;
  border: 1.5px solid rgba(31, 79, 58, 0.3);
  border-radius: 5px;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.7rem;
  transition: var(--transition);
}
.check input:checked + .check-box {
  background: var(--eg-lagoon);
  border-color: var(--eg-lagoon);
  color: white;
}

/* ============================================================
   Primary button
   ============================================================ */

.primary-btn {
  position: relative;
  margin-top: 0.5rem;
  padding: 0.95rem 1.5rem;
  background: linear-gradient(135deg, var(--eg-lagoon) 0%, var(--eg-lagoon-600) 100%);
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(31, 79, 58, 0.32);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.primary-btn:hover {
  box-shadow: 0 14px 36px rgba(31, 79, 58, 0.42);
  transform: translateY(-2px);
}
.primary-btn:active { transform: translateY(0); }
.primary-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.primary-btn:hover::before { transform: translateX(100%); }

.btn-arrow { transition: var(--transition); }
.primary-btn:hover .btn-arrow { transform: translateX(3px); }

.btn-loader {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--eg-lagoon) 0%, var(--eg-lagoon-600) 100%);
}
.primary-btn.loading .btn-text,
.primary-btn.loading .btn-arrow { opacity: 0; }
.primary-btn.loading .btn-loader { display: flex; }
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Footer
   ============================================================ */

.card-foot {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(31, 79, 58, 0.10);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--eg-text-muted);
}
.lock {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(31, 79, 58, 0.10);
  color: var(--eg-lagoon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.page-tagline {
  margin: 1.75rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--eg-text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.tagline-mark {
  font-weight: 700;
  color: var(--eg-lagoon-700);
  letter-spacing: 0.22em;
}

/* ============================================================
   Success animation
   ============================================================ */

.success-animation {
  display: none;
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  align-items: center; justify-content: center;
}
.success-animation.show { display: flex; }
.success-checkmark { width: 100px; height: 100px; }
.check-icon {
  width: 100px; height: 100px;
  position: relative;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid var(--eg-lagoon);
}
.icon-line {
  height: 5px; background: var(--eg-lagoon); display: block;
  border-radius: 2px; position: absolute; z-index: 10;
}
.line-tip { top: 56px; left: 16px; width: 28px; transform: rotate(45deg);
            animation: line-tip 0.75s; transform-origin: left; }
.line-long { top: 48px; right: 8px; width: 52px; transform: rotate(-45deg);
             animation: line-long 0.75s; transform-origin: right; }
@keyframes line-tip {
  0% { width: 0; left: 1px; top: 19px; }
  54% { width: 0; left: 1px; top: 19px; }
  70% { width: 50px; left: -8px; top: 37px; }
  84% { width: 17px; left: 21px; top: 48px; }
  100% { width: 25px; left: 14px; top: 45px; }
}
@keyframes line-long {
  0% { width: 0; right: 46px; top: 54px; }
  65% { width: 0; right: 46px; top: 54px; }
  84% { width: 55px; right: 0; top: 35px; }
  100% { width: 47px; right: 8px; top: 38px; }
}

/* ============================================================
   Loading overlay
   ============================================================ */

#loginLoadingOverlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(245, 239, 230, 0.96);
  backdrop-filter: blur(10px);
  z-index: 9999;
  align-items: center; justify-content: center;
}
#loginLottie { width: 220px; height: 220px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 520px) {
  .login-card { padding: 2rem 1.5rem 1.5rem; }
  .title { font-size: 1.65rem; }
  .brand-logo { height: 54px; }
}
