/* ==========================================================================
   Martin Eduverse - Ultra-Glossy Dark Luxury Login Gate
   Inspired by Reference: Translucent Frosted Glass & Molten Gold Fluid Waves
   ========================================================================== */

/* 1. Global Lock State */
html.martin-locked,
html.martin-locked body {
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
}

html.martin-locked .app-header,
html.martin-locked .main-wrapper,
html.martin-locked .app-footer,
html.martin-locked .modal-backdrop,
html.martin-locked .comparison-floating-bar {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* 2. Authentication Gate Overlay with Horizontal 3D Gold Ribbon Background */
.martin-auth-gate {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: 
    radial-gradient(ellipse at center, rgba(8, 10, 16, 0.35) 0%, rgba(3, 4, 7, 0.85) 100%),
    url('../assets/gold_waves_fluid.jpg') no-repeat center center / cover,
    #030407;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  overflow: hidden;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s ease;
}

/* 3. Luxury Translucent Glassmorphism Card */
.martin-auth-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: rgba(18, 18, 24, 0.46);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  padding: 2.75rem 2.6rem 2.35rem;
  box-shadow: 
    0 35px 90px -15px rgba(0, 0, 0, 0.95),
    0 0 50px rgba(250, 204, 21, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.22);
  box-sizing: border-box;
  text-align: left;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.65s ease, filter 0.65s ease;
}

/* Shake on Invalid Credentials */
.martin-auth-card.shake {
  animation: authShake 0.4s ease-in-out;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Dissolve & Warp Exit Animation */
.martin-auth-card.auth-dissolve {
  transform: scale(0.94) translateY(-14px);
  opacity: 0;
  filter: blur(16px);
  pointer-events: none;
}

.martin-auth-gate.auth-fade-out {
  opacity: 0;
  pointer-events: none;
}

/* 4. Luxury Angled Glass Corner Tabs (Matching Reference Image) */
.glossy-corner-bracket {
  position: absolute;
  width: 58px;
  height: 58px;
  pointer-events: none;
  z-index: 4;
}

.glossy-corner-tl {
  top: -12px;
  left: -12px;
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  border-left: 2px solid rgba(255, 255, 255, 0.45);
  border-top-left-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.01) 70%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: -3px -3px 20px rgba(250, 204, 21, 0.15), inset 1px 1px 8px rgba(255, 255, 255, 0.25);
}

.glossy-corner-br {
  bottom: -12px;
  right: -12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.45);
  border-right: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom-right-radius: 18px;
  background: linear-gradient(315deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.01) 70%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 3px 3px 20px rgba(250, 204, 21, 0.15), inset -1px -1px 8px rgba(255, 255, 255, 0.25);
}

/* 5. Company Logo & Emblem */
.auth-brand-emblem-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.auth-emblem-glow {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.45) 0%, rgba(250, 204, 21, 0) 70%);
  filter: blur(12px);
  z-index: 0;
}

.auth-brand-emblem {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(12, 14, 20, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(250, 204, 21, 0.2);
  padding: 5px;
}

/* 6. Company Title (Matching White + Yellow Reference Style) */
.auth-brand-title {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: #ffffff;
  line-height: 1.2;
}

.gold-gradient-text {
  color: #FACC15;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(250, 204, 21, 0.35);
}

.auth-brand-tagline {
  font-size: 0.88rem;
  color: #a1a1aa;
  margin-top: 0.35rem;
  margin-bottom: 1.75rem;
  font-weight: 400;
}

/* 7. Alerts */
.auth-alert {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.84rem;
  margin-bottom: 1.25rem;
  line-height: 1.35;
}

.auth-alert:empty {
  display: none !important;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

/* 8. Form & Dark Zinc Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

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

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #d4d4d8;
}

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

.auth-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.65rem;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.auth-input::placeholder {
  color: #71717a;
  font-size: 0.88rem;
}

.auth-input:focus {
  background: rgba(24, 24, 27, 0.85);
  border-color: #FACC15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2);
}

.auth-input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.auth-input-leading-icon {
  position: absolute;
  left: 0.85rem;
  color: #71717a;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input:focus ~ .auth-input-leading-icon,
.auth-input-wrapper:focus-within .auth-input-leading-icon {
  color: #FACC15;
}

.auth-pw-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: #71717a;
  padding: 0.35rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-pw-toggle:hover {
  color: #ffffff;
}

/* 9. Options Row */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: #a1a1aa;
  margin-top: -0.2rem;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  accent-color: #FACC15;
  width: 16px;
  height: 16px;
  cursor: pointer;
  border-radius: 4px;
}

/* 10. Vibrant Yellow Pill Button (Exact Match to Reference CTA) */
.btn-auth-submit {
  width: 100%;
  padding: 0.95rem 1.5rem;
  margin-top: 0.6rem;
  background: #FACC15;
  color: #000000;
  border: none;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-auth-submit:hover {
  background: #FDE047;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.45);
}

.btn-auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
}

.btn-auth-submit .btn-auth-arrow {
  transition: transform 0.2s ease;
}

.btn-auth-submit:hover .btn-auth-arrow {
  transform: translateX(4px);
}

/* Loading Ripple State */
.btn-auth-submit.loading {
  pointer-events: none;
  opacity: 0.88;
}

.btn-auth-submit.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* 11. Header Profile Badge & Logout (Generic for Employees) */
.auth-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-secondary, #ffffff);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  padding: 0.25rem 0.6rem 0.25rem 0.4rem;
  border-radius: 9999px;
  margin-left: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.auth-profile-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FACC15;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-profile-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.auth-logout-btn {
  background: var(--bg-primary, #f1f5f9);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.12));
  color: var(--text-secondary, #475569);
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.auth-logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

@media (max-width: 520px) {
  .martin-auth-card {
    padding: 2.2rem 1.6rem 1.8rem;
    border-radius: 20px;
  }
  .glossy-corner-bracket {
    display: none;
  }
}
