@import url(../assets/css/variables.css);

/* =========================
   BASE AUTH STYLES
========================= */
body {
  padding: 0;
  margin: 0;
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}

button {
  appearance: none;
  border: none;
  background-color: none;
  outline: none;
}
a {
  text-decoration: none;
}

.auth-one-bg {
  background-image: url(./images/auth-one-bg.jpg);
  background-position: center;
  background-size: cover;
}

.auth-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 2; /* behind overlays and particles */
}

.auth-bg-layer.active {
  opacity: 1;
}
.auth-one-bg-position {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 380px;
}

.bg-overlay {
  position: absolute;
  height: 100%;
  width: 100%;
  right: 0;
  bottom: 0;
  left: 0;
  top: 0;
  opacity: 0.7;
  background-color: var(--color-black);

  .auth-one-bg & {
    background: var(--gradient-auth-overlay);
    opacity: 0.9;
    z-index: 3;
  }
}

.shape {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;

  & > svg {
    width: 100%;
    height: auto;
    fill: var(--color-white);
  }
}

#auth-particles {
  & .particles-js-canvas-el {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    z-index: 4;
  }
}

.auth-bg-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.auth-bg-layer.active {
  opacity: 1;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
  color: var(--gray-400);
  z-index: 10;

  & .auth-copy {
    color: var(--gray-300);
    font-size: 0.85rem;

    &-text {
      & i {
        margin-right: 4px;
        color: var(--gray-400);
      }

      &::after {
        content: "Built with ❤️ by Nami";
        display: block;
        font-size: 0.85rem;
        color: var(--gray-400);
        margin-top: 2px;
      }
    }
  }
}

/* =========================
   BASE WRAPPER STYLES
========================= */

.auth-page-wrapper {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition:
    grid-template-columns 0.3s ease,
    background 0.3s ease;

  & .auth-page-content {
    padding-bottom: 60px;
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    & .logo-wrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-align: center;
      padding-top: 1rem;
      max-width: 80%;
      margin: 0 auto;
      margin-bottom: 2rem;
    }
  }
}

/* =========================
   SHARED FORM STYLES
========================= */

.auth-page-content {
  & .card {
    border: none;
    border-radius: var(--radius);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-lg);
    transition:
      transform 0.25s ease,
      box-shadow 0.25s ease;
    max-width: 100%;
    margin: 0 auto;

    &:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-lg-hover);
    }

    @media (min-width: 768px) {
      max-width: 66.67%;
    }
    @media (min-width: 992px) {
      max-width: 50%;
    }
    @media (min-width: 1200px) {
      max-width: 41.66667%;
    }
  }

  & .card-body {
    padding: 24px;
    .main-title-auth {
      color: var(--primary);
    }

    @media (max-width: 575px) {
      padding: 24px;
    }
  }

  & h5 {
    font-weight: 700;
    letter-spacing: -0.3px;
  }

  & p.text-muted {
    font-size: 14px;
    margin-bottom: 0;
  }

  /* Form Elements */
  & .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
  }

  & .form-control {
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    font-size: 14px;
    padding: 0 14px;
    transition:
      border-color 0.2s ease,
      box-shadow 0.2s ease;

    &::placeholder {
      color: var(--gray-400);
    }

    &:focus {
      border-color: var(--primary);
      box-shadow: var(--ring-primary-soft);
    }
  }

  /* Checkbox */
  & .form-check {
    margin-top: 12px;

    &-input {
      cursor: pointer;
      accent-color: var(--primary);
    }

    &-label {
      font-size: 13px;
      color: var(--gray-600);
    }
  }

  /* Button */
  & .btn-success {
    background: linear-gradient(135deg, var(--primary), var(--primary-700));
    border: none;
    height: 44px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease;

    &:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow-primary-hover);
    }
  }

  /* Links */
  & a.text-muted {
    font-size: 13px;
    color: var(--gray-500);
    transition: color 0.2s ease;

    &:hover {
      color: var(--primary);
      text-decoration: underline;
    }
  }
}

/* =========================
   DEFAULT LAYOUT (CENTERED)
========================= */

.auth-page-wrapper.auth-layout-default {
  padding-top: 48px;

  & .auth-one-bg-position {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 380px;
  }

  & .auth-page-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 120px);

    & .text-center.mt-sm-5 {
      display: block;
    }
  }
}

/* =========================
   SPLIT LAYOUT (60/40)
========================= */

.auth-page-wrapper.auth-layout-split {
  display: grid;
  grid-template-columns: 3fr 2fr; /* 60% : 40% */
  min-height: 100dvh;
  padding-top: 0;
  background: var(--gray-50);

  /* ===== LEFT SECTION: Visual (Image + Overlay + Particles) ===== */
  & .auth-one-bg-position {
    position: relative;
    width: 100%;
    height: 100dvh;
    grid-column: 1 / 2;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: var(--gradient-auth-visual-radial);
      pointer-events: none;
      z-index: 1;
    }
  }

  & .auth-one-bg {
    background-image: var(--auth-bg-image, url(./images/auth-one-bg.jpg));
  }

  & .bg-overlay {
    background: var(--gradient-auth-split-overlay);
    opacity: 1;
  }

  & .shape {
    display: none;
  }

  /* ===== RIGHT SECTION: Form ===== */
  & .auth-page-content {
    grid-column: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    & .container {
      width: 100%;
      max-width: 520px;
    }

    /* Hide top logo to center card perfectly */
    & .text-center.mt-sm-5 {
      display: none;
    }
  }

  /* ===== CARD REFINEMENT ===== */
  & .card {
    border-radius: 0;
    background: none;
    backdrop-filter: var(--glass-blur);
    box-shadow: none;
    transition:
      box-shadow 0.25s ease,
      transform 0.25s ease;
    max-width: 100%;
    margin: 0 auto;

    &:hover {
      transform: translateY(0px);
      box-shadow: none;
    }
  }
  & .logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding-top: 1rem;
    max-width: 100%;
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 2rem;
  }

  /* ===== RESPONSIVE: TABLET ===== */
  @media (max-width: 991.98px) {
    grid-template-columns: 1fr; /* Collapse to single column */

    & .auth-one-bg-position {
      height: 100dvh;
    }

    & .auth-page-content {
      min-height: auto;
      padding-top: 16px;
      padding-bottom: 32px;

      & .container {
        max-width: 600px;
      }
    }
  }

  /* ===== RESPONSIVE: MOBILE ===== */
  @media (max-width: 575px) {
    & .auth-page-content .card-body {
      padding: 24px;
    }
  }
}

/* =========================
   LANGUAGE SELECTOR
========================= */

.auth-lang-switch {
  z-index: 1200;
  display: flex;
  align-items: center;
  background-color: var(--primary);
  backdrop-filter: var(--glass-blur);
  padding: 4px 12px;
  border-radius: 100px;
  outline: none;
  border: none;
  color: var(--color-white);
  font-size: 14px;
  gap: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  &::after {
    display: none;
  }
  &:hover {
    background-color: var(--primary-hover);
  }

  & i.auth-lang-icon {
    font-size: 1rem;
    transition:
      transform 0.3s ease,
      color 0.3s ease;

    &:hover {
      transform: rotate(20deg);
      color: var(--primary);
    }
  }
}

/* Standalone Language Select (Premium Style) */
.auth-lang-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px 34px 10px 36px;
  border-radius: 999px;
  border: 1px solid var(--gray-300);
  background: linear-gradient(135deg, var(--glass-bg), var(--glass-bg-subtle));
  backdrop-filter: var(--glass-blur);
  color: var(--gray-800);
  font-size: 12px;
  box-shadow: var(--shadow-md);
  transition:
    box-shadow 0.25s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  cursor: pointer;
  position: relative;

  &:hover {
    box-shadow: var(--shadow-lg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
  }

  &:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring-primary-soft);
  }
}

/* =========================
   FORM LOGO BASE (Hidden by default)
========================= */

.auth-form-logo {
  display: none;
  margin-bottom: 12px;
}

/* ==================================
   OTP Styles (CSS Variables + Nested)
==================================== */

#otp-form {
  /* ================= OTP Inputs ================= */
  .otp-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;

    input {
      width: 65px;
      height: 65px;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 28px;
      font-weight: 600;
      text-align: center;
      color: var(--dark);
      transition: var(--transition);
      caret-color: var(--primary);

      &:focus {
        border-color: var(--primary);
        box-shadow: var(--ring-info-soft);
        outline: none;
        transform: scale(1.05);
      }

      &.filled {
        border-color: var(--success);
        background-color: var(--bg-success-soft);
      }

      &.error {
        border-color: var(--danger);
        background-color: var(--bg-danger-soft);
        animation: shake 0.3s ease;
      }
    }
  }
}

/* ================= Verify Button ================= */
.btn-verify {
  width: 100%;
  background-color: var(--primary);
  border: none;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition);
  margin-bottom: 20px;
  color: var(--color-white);

  &:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
  }

  &:disabled {
    background-color: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }
}

/* ================= Messages ================= */
.message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
  display: none;

  &.success {
    background-color: var(--bg-success-subtle);
    color: var(--success-strong);
    display: block;
  }

  &.error {
    background-color: var(--bg-danger-subtle);
    color: var(--danger-strong);
    display: block;
  }

  &.info {
    background-color: var(--bg-info-subtle);
    color: var(--info-strong);
    display: block;
  }
}

/* ================= Resend Section ================= */
.resend-section {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);

  span {
    color: var(--muted);
    margin-right: 6px;
  }

  .resend-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);

    &:hover {
      color: var(--primary-hover);
      text-decoration: underline;
    }

    &.disabled {
      color: var(--gray-300);
      cursor: not-allowed;
      text-decoration: none;
    }
  }

  .countdown {
    color: var(--danger);
    font-weight: 600;
  }
}

/* ================= Animations ================= */
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0);
  }
}

/* ================= Responsive ================= */
@media (max-width: 576px) {
  .otp-container {
    padding: 30px 25px;

    .otp-inputs {
      gap: 10px;

      input {
        width: 55px;
        height: 55px;
        font-size: 24px;
      }
    }
  }
}

@media (max-width: 400px) {
  .otp-container {
    .otp-inputs input {
      width: 50px;
      height: 50px;
      font-size: 22px;
    }
  }
}
.themeColor {
  position: fixed;
  top: 50%;
  inset-inline-end: 0;
  transform: translateY(-50%);
  z-index: 20;
}
