/**
 * مطابقة صفحة الدخول لـ acc-fr.ggw.ly (نفس CSS المستخرج من الحزمة الأصلية)
 * --main-color: #af7813 | خلفية #c7c7c7 | صندوق متحرك الحدود + نموذج داخلي #fafafa
 */
:root {
  --main-color: #af7813;
}

body {
  margin: 0;
  font-family: "Tajawal", "Noto Kufi Arabic", system-ui, sans-serif;
}

.ggw-login {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #c7c7c7;
  overflow: hidden;
}

/* دخول الصفحة: خلفية لطيفة + صندوق يطفو للأعلى */
.ggw-login::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 65% at 50% 35%, rgba(255, 255, 255, 0.45) 0%, transparent 62%);
  opacity: 0;
  animation: ggw-login-ambient-in 1s ease-out 0.05s forwards;
}

.ggw-box {
  position: relative;
  z-index: 1;
  width: 380px;
  height: 530px;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  transition:
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s ease,
    filter 0.45s ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  animation-name: ggw-login-box-enter, ggw-login-box-shadow;
  animation-duration: 0.72s, 0.9s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1), ease-out;
  animation-delay: 0.12s, 0.12s;
  animation-fill-mode: both, forwards;
}

@keyframes ggw-login-ambient-in {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ggw-login-box-enter {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ggw-login-box-shadow {
  from {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0);
  }
  to {
    box-shadow: 0 28px 56px rgba(35, 36, 42, 0.14), 0 8px 24px rgba(175, 120, 19, 0.12);
  }
}

@keyframes ggw-login-form-inner {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ggw-login::after,
  .ggw-box,
  .ggw-form {
    animation: none !important;
  }

  .ggw-login::after {
    opacity: 1;
    transform: none;
  }

  .ggw-box {
    box-shadow: 0 20px 40px rgba(35, 36, 42, 0.1);
  }

  .ggw-box::before {
    animation: none;
  }
}

@media (max-width: 499px) {
  .ggw-box {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }
}

.ggw-box::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 380px;
  height: 420px;
  background: linear-gradient(0deg, transparent, var(--main-color), var(--main-color));
  transform-origin: bottom right;
  animation: ggw-login-spin 6s linear infinite;
}

[dir="rtl"] .ggw-box::before {
  left: auto;
  right: -50%;
  transform-origin: bottom left;
}

@keyframes ggw-login-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ggw-form {
  position: absolute;
  background: #fafafa;
  border-radius: 8px;
  inset: 2px;
  z-index: 10;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  animation: ggw-login-form-inner 0.55s ease-out 0.38s both;
}

@media (max-width: 499px) {
  .ggw-form {
    justify-content: center;
    gap: 1rem;
  }
}

.ggw-form h2 {
  color: var(--main-color);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.1em;
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.ggw-brandBlock {
  text-align: center;
  margin-bottom: 0.5rem;
}

.ggw-coverImg {
  height: 88px;
  width: 88px;
  object-fit: contain;
  align-self: center;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

/* شعار GGW الأفقي (acc-fr) */
.ggw-brandImg {
  display: block;
  width: min(100%, 240px);
  max-height: 100px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.1));
}

.ggw-appVersion {
  margin: 1.35rem 0 0;
  padding: 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #868e96;
}

.ggw-productName {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #23242a;
  margin-bottom: 2px;
}

.ggw-productTag {
  font-size: 0.78rem;
  color: #8f8f8f;
  font-weight: 500;
}

.ggw-alert {
  margin: 0.5rem 0 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  background: rgba(220, 53, 69, 0.12);
  color: #842029;
  border: 1px solid rgba(220, 53, 69, 0.25);
  text-align: center;
}

.ggw-inputBox {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  margin-top: 35px;
}

.ggw-inputBox input {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 10px 10px;
  border: none;
  outline: none;
  background: transparent;
  color: #23242a;
  font-size: 1em;
  letter-spacing: 0.05em;
  z-index: 10;
  font-family: inherit;
}

.ggw-inputBox span.ggw-floating-label {
  position: absolute;
  inset-inline-start: 0;
  padding: 20px 0 10px;
  font-size: 1em;
  color: #8f8f8f;
  pointer-events: none;
  letter-spacing: 0.05em;
  transition: all 0.2s ease-in-out;
}

.ggw-inputBox input:valid ~ span.ggw-floating-label,
.ggw-inputBox input:focus ~ span.ggw-floating-label {
  transform: translateY(-34px);
  font-size: 0.75em;
}

.ggw-inputBox i {
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-bottom: 1px solid var(--main-color);
  border-radius: 4px;
  transition: 0.5s;
  pointer-events: none;
  z-index: 9;
}

.ggw-inputBox input:valid ~ i,
.ggw-inputBox input:focus ~ i {
  height: 44px;
}

.ggw-links {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.ggw-links a {
  margin: 10px 0;
  font-size: 0.75em;
  color: #8f8f8f;
  text-decoration: none;
}

.ggw-links a:hover,
.ggw-links a:nth-child(2) {
  color: var(--main-color);
}

.ggw-button {
  background: var(--main-color);
  font-size: 13px;
  margin-top: 15px;
  padding: 12px 20px;
  text-transform: capitalize;
  font-weight: 600;
  color: #23242a;
  cursor: pointer;
  border: none;
  font-family: inherit;
  border-radius: 2px;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  display: block;
}

.ggw-button:hover,
.ggw-button:focus {
  opacity: 0.7;
}

.ggw-button span {
  color: #fff;
}

.ggw-button:disabled {
  cursor: wait;
  opacity: 0.85;
}

.ggw-login.is-leaving .ggw-box {
  transform: scale(0.94) translateY(12px);
  opacity: 0.25;
  filter: blur(2px);
}

.ggw-login.is-success .ggw-box {
  transform: scale(0.88);
  opacity: 0;
  filter: blur(4px);
}

.ggw-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.35) 0%, rgba(199, 199, 199, 0.92) 55%, rgba(175, 120, 19, 0.22) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    background 0.55s ease;
}

.ggw-login.is-leaving .ggw-login-overlay,
.ggw-login.is-success .ggw-login-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ggw-login.is-success .ggw-login-overlay {
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 220, 160, 0.55) 0%, rgba(175, 120, 19, 0.45) 42%, rgba(35, 36, 42, 0.88) 78%);
  animation: ggw-login-success-pulse 0.55s ease-out forwards;
}

@keyframes ggw-login-success-pulse {
  0% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.15);
  }
  100% {
    filter: brightness(1.05);
  }
}

.ggw-login-overlay-card {
  text-align: center;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  background: rgba(250, 250, 250, 0.92);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(175, 120, 19, 0.25);
  transform: scale(0.92);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.35s ease;
}

.ggw-login.is-leaving .ggw-login-overlay-card,
.ggw-login.is-success .ggw-login-overlay-card {
  transform: scale(1);
  opacity: 1;
}

.ggw-login-overlay-msg {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #23242a;
  letter-spacing: 0.04em;
}

.ggw-login-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(175, 120, 19, 0.2);
  border-top-color: var(--main-color);
  animation: ggw-login-spin-loader 0.75s linear infinite;
}

@keyframes ggw-login-spin-loader {
  to {
    transform: rotate(360deg);
  }
}

/* ——— توست خطأ الدخول (من الأسفل) ——— */
.ggw-toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  width: min(440px, calc(100vw - 28px));
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 0 4px;
}

.ggw-toast__surface {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  border-radius: 16px;
  overflow: hidden;
  color: #3d1814;
  background: linear-gradient(155deg, rgba(255, 254, 252, 0.98) 0%, rgba(252, 246, 240, 0.97) 45%, rgba(255, 248, 242, 0.98) 100%);
  border: 1px solid rgba(180, 45, 35, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 8px 28px rgba(180, 45, 35, 0.14),
    0 22px 48px rgba(35, 36, 42, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: ggw-toast-in 0.88s cubic-bezier(0.34, 1.45, 0.55, 1) both;
}

.ggw-toast__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 36%,
    rgba(255, 255, 255, 0.72) 48%,
    transparent 58%
  );
  background-size: 220% 100%;
  animation: ggw-toast-sheen 2.6s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.ggw-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  border-radius: 12px;
  color: #9a241c;
  background: linear-gradient(145deg, rgba(180, 45, 35, 0.12), rgba(175, 120, 19, 0.1));
  box-shadow: 0 2px 8px rgba(180, 45, 35, 0.12);
  animation: ggw-toast-icon-pop 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) 0.2s both;
}

.ggw-toast__text {
  flex: 1;
  margin: 0;
  padding-top: 4px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.ggw-toast__dismiss {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #6b2a24;
  background: rgba(180, 45, 35, 0.08);
  transition: background 0.2s ease, transform 0.15s ease;
}

.ggw-toast__dismiss:hover {
  background: rgba(180, 45, 35, 0.16);
  transform: scale(1.06);
}

.ggw-toast__dismiss:focus-visible {
  outline: 2px solid var(--main-color);
  outline-offset: 2px;
}

.ggw-toast--hide .ggw-toast__surface {
  animation: none;
}

.ggw-toast--hide .ggw-toast__sheen {
  opacity: 0;
}

.ggw-toast--hide {
  animation: ggw-toast-exit 0.48s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
  pointer-events: none;
}

@keyframes ggw-toast-in {
  0% {
    opacity: 0;
    transform: translateY(calc(100% + 36px)) scale(0.88);
    filter: blur(4px);
  }
  58% {
    opacity: 1;
    transform: translateY(-12px) scale(1.03);
    filter: blur(0);
  }
  78% {
    transform: translateY(4px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes ggw-toast-icon-pop {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-12deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes ggw-toast-sheen {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes ggw-toast-exit {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(calc(100% + 48px)) scale(0.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ggw-toast__surface {
    animation: ggw-toast-in-reduced 0.35s ease-out both;
  }

  .ggw-toast__sheen {
    animation: none;
    opacity: 0.25;
  }

  .ggw-toast__icon {
    animation: none;
  }

  .ggw-toast--hide {
    animation: ggw-toast-exit-reduced 0.25s ease-out forwards;
  }

  @keyframes ggw-toast-in-reduced {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes ggw-toast-exit-reduced {
    to {
      opacity: 0;
    }
  }
}
