/* ---------------------------------------------
   Shared variables and base page styling
---------------------------------------------- */
:root {
  --auth-width: 408px;
  --control-height: 54px;
}

html {
  min-height: 100%;
  background: var(--color-bg, #090909);
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  background:
    url("../../../assets/auth/stars.png") top center / auto no-repeat,
    url("../../../assets/auth/Light.png") top center / min(1440px, 210vw) auto
      no-repeat,
    var(--color-bg, #090909);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  animation: fadeIn 1s ease both;
}

.linear-border {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary),
    transparent
  );
  animation: slideGradient 3s linear infinite;
  z-index: 9999;
}

/* ---------------------------------------------
   Page layout and authentication shell
---------------------------------------------- */
.login-page {
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 122px 24px 48px;
}

.login-shell {
  width: min(var(--auth-width), 100%);
}

.login-body {
  width: 100%;
}

/* ---------------------------------------------
   Brand area and login heading
---------------------------------------------- */
.brand-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.brand-mark__logo {
  display: block;
  height: 58px;
  width: auto;
  object-fit: contain;
}

.login-title {
  margin-bottom: 32px;
  text-align: center;
  color: var(--color-text-soft);
  line-height: 1.4;
}

.login-title h1 {
  color: inherit;
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 10px;
}

.login-title p {
  font-size: 13px;
  font-weight: 400;
}

/* ---------------------------------------------
   Login method switcher (Email / Phone)
---------------------------------------------- */
.login-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  height: 40px;
  margin-bottom: 32px;
  padding: 4px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--color-bg-elevated);
}

.login-switch .tab-link {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.login-switch .tab-link.is-active {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------
   Login form layout and field groups
---------------------------------------------- */
.login-form {
  display: grid;
  gap: 22px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-label {
  color: var(--color-text-soft);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
}

/* ---------------------------------------------
   Universal Outlined Floating Labels
---------------------------------------------- */
.password-group,
.email-group,
.name-group {
  position: relative;
  margin-top: 10px;
}

.password-group .form-label,
.email-group .form-label,
.name-group .form-label {
  position: absolute;
  left: 12px;
  top: -7px;
  background: #090909;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  z-index: 1;
  letter-spacing: 0.05em;
  pointer-events: none;
  border-radius: 5px;
}
.form-group:focus-within .form-label {
  color: var(--color-primary);
}
.form-control {
  width: 100%;
  display: flex;
  align-items: center;
  height: var(--control-height);
  gap: 12px;
  border: 1px solid var(--color-border-faint);
  border-radius: 8px;
  background: #1f1f1f;
  color: #fff;
  padding: 0 16px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-control:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.form-control input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  height: 100%;
}

.form-control input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.input-icon,
.password-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--color-text-soft);
}

.input-icon svg,
.password-toggle svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.password-toggle {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

/* ---------------------------------------------
   Remember me / forgot password section
---------------------------------------------- */
.form-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

.checkbox-container input {
  display: none;
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  background: transparent;
  position: relative;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.checkbox-container input:checked + .custom-checkbox {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.custom-checkbox::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.checkbox-container input:checked + .custom-checkbox::after {
  opacity: 1;
}

.form-help a {
  color: var(--color-text-dim);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
}

.form-help a:hover,
.login-footer a:hover {
  color: var(--color-primary);
}

/* ---------------------------------------------
   Primary submit button
---------------------------------------------- */
.btn-login {
  width: 100%;
  height: 54px;
  margin-top: 20px;
  border: 0;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-login:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

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

.login-footer {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.login-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.form-control.is-invalid {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 1px var(--color-error) !important;
}

.form-error {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-error);
}

.login-alert {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  text-align: center;
}

.login-alert--error {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---------------------------------------------
   Social login buttons
---------------------------------------------- */
.social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 5px 0;
}

.social-divider::before,
.social-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.social-divider:not(:empty)::before {
  margin-right: 16px;
}

.social-divider:not(:empty)::after {
  margin-left: 16px;
}

.social-divider span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

a.social-btn {
  text-decoration: none;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid var(--color-border-faint);
  border-radius: 8px;
  background: #1f1f1f;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.social-btn:hover {
  border-color: var(--color-primary);
  background: #262626;
  transform: translateY(-1px);
}

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

.social-btn svg,
.social-btn i {
  display: block;
  width: 20px;
  height: 20px;
  color: #fff;
  stroke-width: 1.5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  :root {
    --control-height: 48px;
  }

  .login-page {
    padding-top: 92px;
  }

  .login-title {
    margin-bottom: 66px;
  }

  .login-switch {
    margin-bottom: 40px;
  }

  .form-help,
  .login-footer {
    font-size: 10px;
  }
}

/* ---------------------------------------------
   Modal Component Styles
---------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-overlay-soft);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #181818;
  border: 1px solid var(--color-border-faint);
  border-radius: 24px;
  padding: 36px 24px 24px;
  width: min(342px, 90vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-spring);
}

.modal-backdrop.is-active .modal-content {
  transform: scale(1);
}

.modal-icon-wrapper {
  margin-bottom: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-wrapper img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.modal-icon-glow {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.25;
  z-index: -1;
}

.modal-icon-glow--success {
  background: #4caf7d;
}

.modal-icon-glow--faild {
  background: #e05252;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}

.modal-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
  margin-bottom: 28px;
  font-weight: 400;
  padding: 0 10px;
}

.modal-btn {
  width: 100%;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.modal-btn:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

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