/* =========================================================
   BOM JOBS — Auth Pages (Login / Registo / Escolha)
   Premium split-screen layout com glassmorphism
   ========================================================= */

/* ---------- Layout: split screen ---------- */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- Branding Panel (esquerdo) ---------- */
.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48%;
  min-height: 100vh;
  padding: 3rem 3.5rem;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-950) 60%, #040b18 100%);
  overflow: hidden;
  color: #fff;
}

/* Grain/dot overlay */
.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 1;
}

/* Orange glow */
.auth-brand-panel::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,.2) 0%, transparent 70%);
  top: -120px;
  right: -160px;
  pointer-events: none;
  z-index: 1;
}

.auth-brand-content {
  position: relative;
  z-index: 2;
  max-width: 420px;
  text-align: center;
}

.auth-brand-logo {
  height: 64px;
  width: auto;
  border-radius: 14px;
  margin-bottom: 2.2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  transition: transform .3s ease;
}

.auth-brand-logo:hover {
  transform: scale(1.06) rotate(-2deg);
}

.auth-brand-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.auth-brand-content h1 .accent {
  color: var(--orange-400);
}

.auth-brand-content p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* Floating feature cards inside brand panel */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 360px;
}

.auth-feature-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .25s ease, background .25s ease;
}

.auth-feature-card:hover {
  transform: translateX(6px);
  background: rgba(255,255,255,.1);
}

.auth-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,107,53,.15);
  color: var(--orange-400);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.auth-feature-text strong {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: .15rem;
}

.auth-feature-text span {
  font-size: .8rem;
  color: rgba(255,255,255,.55);
  line-height: 1.4;
}

/* Animated floating shapes */
.auth-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.auth-shape-1 {
  width: 200px;
  height: 200px;
  border: 1px solid rgba(255,255,255,.04);
  bottom: 5%;
  left: -60px;
  animation: auth-float 14s ease-in-out infinite;
}

.auth-shape-2 {
  width: 120px;
  height: 120px;
  background: rgba(255,107,53,.06);
  top: 20%;
  right: -30px;
  animation: auth-float 10s ease-in-out infinite reverse;
}

.auth-shape-3 {
  width: 80px;
  height: 80px;
  border: 1px solid rgba(255,255,255,.06);
  bottom: 25%;
  right: 15%;
  animation: auth-float 12s ease-in-out infinite 2s;
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(5deg); }
  66% { transform: translateY(10px) rotate(-3deg); }
}

/* ---------- Form Panel (direito) ---------- */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
}

/* Subtle gradient background for form panel */
.auth-form-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,.04) 0%, transparent 70%);
  pointer-events: none;
}

.auth-form-container {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

/* ---------- Glassmorphism card ---------- */
.auth-card {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 24px;
  padding: 2.8rem 2.5rem;
  box-shadow:
    0 4px 24px rgba(11,37,69,.06),
    0 16px 56px rgba(11,37,69,.08);
  animation: auth-cardIn .6s cubic-bezier(.22,.68,0,1.2) forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes auth-cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card header */
.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card-header .auth-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-400));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(255,107,53,.25);
  transition: transform .3s ease;
}

.auth-card-header .auth-icon:hover {
  transform: rotate(-10deg) scale(1.08);
}

.auth-card-header h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: .4rem;
  letter-spacing: -0.02em;
}

.auth-card-header p {
  font-size: .92rem;
  color: var(--slate);
  margin: 0;
  line-height: 1.5;
}

/* ---------- Form inputs ---------- */
.auth-input-group {
  position: relative;
  margin-bottom: 1.3rem;
}

.auth-input-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: .45rem;
  letter-spacing: .01em;
}

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

.auth-input-wrap .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--slate);
  font-size: 1.05rem;
  pointer-events: none;
  transition: color .25s ease;
  z-index: 2;
}

.auth-input-wrap input,
.auth-input-wrap select {
  width: 100%;
  padding: .82rem 1rem .82rem 2.8rem;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--ink);
  background: rgba(247,248,251,.8);
  border: 1.5px solid var(--slate-200);
  border-radius: 14px;
  transition: all .25s ease;
  outline: none;
}

.auth-input-wrap input:focus,
.auth-input-wrap select:focus {
  background: #fff;
  border-color: var(--orange-400);
  box-shadow: 0 0 0 4px rgba(255,107,53,.1);
}

.auth-input-wrap input:focus ~ .input-icon,
.auth-input-wrap select:focus ~ .input-icon {
  color: var(--orange-500);
}

.auth-input-wrap input::placeholder {
  color: #b0b8c4;
  font-weight: 400;
}

/* Password toggle */
.auth-pw-toggle {
  position: absolute;
  right: .8rem;
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  padding: .3rem;
  font-size: 1.1rem;
  z-index: 2;
  transition: color .2s ease;
  line-height: 1;
}

.auth-pw-toggle:hover {
  color: var(--orange-500);
}

/* Two-column row */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---------- Remember / Forgot ---------- */
.auth-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: .85rem;
}

.auth-extras .form-check {
  margin: 0;
}

.auth-extras .form-check-input {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--slate-200);
  border-radius: 6px;
  margin-top: 0;
  cursor: pointer;
  transition: all .2s ease;
}

.auth-extras .form-check-input:checked {
  background-color: var(--orange-500);
  border-color: var(--orange-500);
}

.auth-extras .form-check-label {
  color: var(--slate);
  font-size: .85rem;
  cursor: pointer;
  margin-left: .35rem;
}

.auth-extras a {
  color: var(--orange-500);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}

.auth-extras a:hover {
  color: var(--orange-600);
}

/* ---------- Submit button ---------- */
.auth-submit {
  width: 100%;
  padding: .9rem 1.5rem;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,107,53,.3);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  position: relative;
  overflow: hidden;
}

.auth-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,.15));
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,107,53,.4);
}

.auth-submit:hover::before {
  opacity: 1;
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(255,107,53,.25);
}

/* Navy submit variant */
.auth-submit.auth-submit-navy {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  box-shadow: 0 6px 20px rgba(11,37,69,.25);
}

.auth-submit.auth-submit-navy:hover {
  box-shadow: 0 10px 30px rgba(11,37,69,.35);
}

/* ---------- Divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.8rem 0;
  color: var(--slate);
  font-size: .82rem;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--slate-200), transparent);
}

/* ---------- Auth footer link ---------- */
.auth-footer-link {
  text-align: center;
  font-size: .88rem;
  color: var(--slate);
  margin-top: .5rem;
}

.auth-footer-link a {
  color: var(--navy-900);
  font-weight: 700;
  text-decoration: none;
  position: relative;
  transition: color .2s;
}

.auth-footer-link a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange-500);
  border-radius: 2px;
  transition: width .3s ease;
}

.auth-footer-link a:hover {
  color: var(--orange-500);
}

.auth-footer-link a:hover::after {
  width: 100%;
}

/* ---------- Alerts ---------- */
.auth-alert {
  padding: .85rem 1.1rem;
  border-radius: 12px;
  font-size: .86rem;
  font-weight: 500;
  margin-bottom: 1.3rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  animation: auth-shake .4s ease;
}

.auth-alert.auth-alert-danger {
  background: rgba(220,53,69,.08);
  border: 1px solid rgba(220,53,69,.2);
  color: #b91c30;
}

.auth-alert .alert-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: .05rem;
}

.auth-alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

.auth-alert ul li {
  margin-bottom: .2rem;
}

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

/* ---------- Choice page cards ---------- */
.auth-choice-wrapper {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  background:
    radial-gradient(800px 400px at 30% 20%, rgba(255,107,53,.06), transparent 60%),
    radial-gradient(600px 300px at 70% 80%, rgba(11,37,69,.04), transparent 60%),
    var(--bg);
}

.auth-choice-container {
  width: 100%;
  max-width: 520px;
  animation: auth-cardIn .6s cubic-bezier(.22,.68,0,1.2) forwards;
  opacity: 0;
  transform: translateY(20px);
}

.auth-choice-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-choice-header .eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange-600);
  font-weight: 600;
}

.auth-choice-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--navy-900);
  margin-top: .5rem;
  margin-bottom: .5rem;
}

.auth-choice-header p {
  font-size: .95rem;
  color: var(--slate);
}

.auth-choice-card {
  display: block;
  text-decoration: none;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid rgba(255,255,255,.6);
  border-radius: 22px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow:
    0 4px 24px rgba(11,37,69,.06),
    0 16px 56px rgba(11,37,69,.08);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: inherit;
}

.auth-choice-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,107,53,.02), rgba(11,37,69,.02));
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.auth-choice-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 8px 32px rgba(11,37,69,.1),
    0 24px 64px rgba(11,37,69,.12);
  border-color: var(--orange-400);
  color: inherit;
}

.auth-choice-card:hover::before {
  opacity: 1;
}

.auth-choice-card .choice-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.4rem;
  font-size: 1.8rem;
  box-shadow: 0 8px 24px rgba(11,37,69,.2);
  transition: all .3s ease;
  position: relative;
  z-index: 2;
}

.auth-choice-card:hover .choice-icon {
  transform: scale(1.08) rotate(-5deg);
  box-shadow: 0 12px 32px rgba(11,37,69,.25);
}

.auth-choice-card h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: .6rem;
  position: relative;
  z-index: 2;
}

.auth-choice-card p {
  font-size: .9rem;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 1.6rem;
  position: relative;
  z-index: 2;
}

.auth-choice-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border: none;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(11,37,69,.2);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  z-index: 2;
}

.auth-choice-card:hover .auth-choice-btn,
.auth-choice-btn:hover {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(11,37,69,.3);
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
}

/* ---------- Mobile back to home ---------- */
.auth-mobile-home {
  display: none;
  text-align: center;
  margin-top: 1.5rem;
}

.auth-mobile-home a {
  color: var(--slate);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: color .2s;
}

.auth-mobile-home a:hover {
  color: var(--orange-500);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 991.98px) {
  .auth-brand-panel {
    width: 42%;
    padding: 2.5rem 2rem;
  }

  .auth-brand-content h1 {
    font-size: 1.65rem;
  }

  .auth-form-panel {
    padding: 2rem 2rem;
  }

  .auth-card {
    padding: 2.2rem 2rem;
  }
}

@media (max-width: 767.98px) {
  .auth-wrapper {
    flex-direction: column;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    padding: 6.5rem 1.5rem 3rem;
    min-height: 100vh;
    align-items: flex-start;
  }

  .auth-form-container {
    max-width: 100%;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .auth-card-header .auth-icon {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
    border-radius: 15px;
    margin-bottom: 1rem;
  }

  .auth-card-header h2 {
    font-size: 1.35rem;
  }

  .auth-row {
    grid-template-columns: 1fr;
    gap: .6rem;
  }

  .auth-mobile-home {
    display: block;
  }

  /* Choice page */
  .auth-choice-wrapper {
    padding: 6rem 1rem 2rem;
  }

  .auth-choice-card {
    padding: 2rem 1.5rem;
    border-radius: 18px;
  }
}

@media (max-width: 374.98px) {
  .auth-form-panel {
    padding: 6rem 1rem 2rem;
  }

  .auth-card {
    padding: 1.6rem 1.2rem;
    border-radius: 16px;
  }

  .auth-input-wrap input,
  .auth-input-wrap select {
    font-size: .86rem;
    padding: .75rem .85rem .75rem 2.5rem;
  }

  .auth-submit {
    font-size: .88rem;
    padding: .8rem 1.2rem;
  }
}

/* ============ Hide chrome on auth pages ============ */
.auth-page ~ .footer,
body:has(.auth-wrapper) .footer,
body:has(.auth-choice-wrapper) .footer {
  display: none;
}

body:has(.auth-wrapper) .navbar-bomjobs {
  background: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 767.98px) {
  body:has(.auth-wrapper) .navbar-bomjobs {
    background: rgba(255,255,255,.92) !important;
    border-bottom-color: var(--slate-200) !important;
  }
}

body:has(.auth-choice-wrapper) .navbar-bomjobs {
  background: rgba(247,248,251,.7) !important;
  backdrop-filter: blur(14px) saturate(160%);
}

body:has(.auth-choice-wrapper) .navbar-bomjobs.is-scrolled {
  background: rgba(255,255,255,.88) !important;
  border-bottom-color: var(--slate-200) !important;
  box-shadow: 0 6px 24px rgba(11,37,69,.08) !important;
}

/* ============ Animations: stagger form fields ============ */
.auth-card .auth-input-group:nth-child(1) { animation: auth-fieldIn .5s .1s ease both; }
.auth-card .auth-input-group:nth-child(2) { animation: auth-fieldIn .5s .18s ease both; }
.auth-card .auth-input-group:nth-child(3) { animation: auth-fieldIn .5s .26s ease both; }
.auth-card .auth-input-group:nth-child(4) { animation: auth-fieldIn .5s .34s ease both; }
.auth-card .auth-input-group:nth-child(5) { animation: auth-fieldIn .5s .42s ease both; }
.auth-card .auth-row { animation: auth-fieldIn .5s .26s ease both; }

@keyframes auth-fieldIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus ring animation for accessibility */
.auth-input-wrap input:focus-visible,
.auth-input-wrap select:focus-visible {
  outline: 3px solid rgba(255,107,53,.3);
  outline-offset: 2px;
}

/* Select custom styling */
.auth-input-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
