/* [UX-01] Stage Overlays */
.ux-stage-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.52), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.38), transparent 28%),
    linear-gradient(180deg, #F7F2E8 0%, #f9f4e5 34%, #f7f1e0 100%);
  transition: opacity 0.4s ease;
}

.ux-stage-overlay.is-hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

#ux-stage-instruction_loading {
  background: transparent;
}

.auth-loading-panel {
  --instruction-scale: 1.3;
}

/* [UX-02] Splash Screen Styles */
#ux-stage-boot_splash {
  background: transparent;
  z-index: 10001; /* Highest priority */
}

.splash-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.splash-lottie {
  display: none;
  width: 100%;
  height: 100%;
  max-width: 640px; /* PC?ì„œ???ì ˆ???¬ê¸° ? ì? */
  max-height: 80vh;
}

.splash-lottie.is-active {
  display: block;
}

.splash-static-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F7F2E8;
  z-index: 1;
  transition: opacity 0.5s ease-out;
}

.splash-static-layer.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-static-icon {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ê°€ë¡œì„¸ë¡?ë¹„ìœ¨ ? ì??˜ë©° ?˜ë¦¬ì§€ ?Šê²Œ ?œì‹œ */
  opacity: 0;
  transition: opacity 0.6s ease-in;
}

.splash-static-icon.is-active {
  opacity: 1;
}

.splash-static-placeholder {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  color: #171512;
  font-weight: 900;
  font-size: 64px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.04em;
  box-shadow: inset 0 0 0 2px rgba(76, 156, 55, 0.2);
}

.auth-screen-root {
  min-height: 100%;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: transparent;
}

.auth-fullscreen {
  padding: clamp(16px, 4vw, 32px);
}

.auth-modal-mode {
  position: fixed;
  inset: 0;
  z-index: 10002;
  align-items: center;
  justify-content: center;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 42, 32, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1;
  animation: backdrop-fade-in 0.3s ease-out;
}

@keyframes backdrop-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-panel {
  position: relative;
  width: 100%;
  background: #ebe6d6;
  border-radius: 24px;
  box-shadow: 0 24px 54px rgba(32, 28, 20, 0.25), 0 0 0 1px rgba(109, 96, 73, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auth-panel-fullscreen {
  max-width: 900px;
  margin: auto;
}

.auth-panel-modal {
  z-index: 2;
  width: min(560px, 92vw);
  max-height: min(720px, 90vh);
  margin: 0;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(109, 96, 73, 0.25);
  animation: modal-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  padding: 36px 32px 24px;
  text-align: center;
  background: linear-gradient(180deg, #efebdc 0%, #e6e0cb 100%);
  border-bottom: 2px solid #4f9a43;
}

.auth-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 300;
  color: #6c6458;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  z-index: 10;
  transition: color 0.2s;
}

.auth-close-btn:hover {
  color: #27231c;
}

.auth-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: #27231c;
  letter-spacing: -0.04em;
}
.title-icon {
  font-size: 24px;
}

.auth-subtitle {
  margin: 0;
  font-size: 14.5px;
  color: #5b6b44;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-body {
  padding: 24px 32px 12px;
  background: linear-gradient(180deg, #ebe6d6 0%, #e3decd 100%);
}

.recent-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: #FFB800;
  color: #513600;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border: 2px solid white;
  z-index: 2;
  white-space: nowrap;
}
.linked-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: #4f9a43;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border: 2px solid white;
  z-index: 2;
  white-space: nowrap;
}

.auth-providers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.eval-providers, .personal-provider {
  grid-template-columns: 1fr;
}

.auth-btn {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  height: 48px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: visible; /* To allow recent-badge to overlay correctly */
  padding-right: 12px;
}

.auth-btn:active {
  transform: scale(0.98);
}
.auth-btn.is-linked {
  cursor: default;
  opacity: 0.65;
  filter: grayscale(0.5);
}
.auth-btn.is-linked:active {
  transform: none;
}

.provider-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-self: center;
}

.auth-btn-label {
  justify-self: center;
  text-align: center;
  width: 100%;
}

.btn-apple { background: #000; color: #fff; }
.btn-google { background: #fff; color: #333; border: 1px solid #e0e0e0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.btn-facebook { background: #1877F2; color: #fff; }
.btn-naver {
  background: #03A94D;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.btn-naver .provider-icon {
  color: #FFFFFF;
}

.btn-naver .naver-icon-svg {
  width: 18px;
  height: 18px;
}
.btn-kakao { background: #FEE500; color: #191919; }

.btn-dummy-1, .btn-dummy-2 { 
  background: #fdfdfd; 
  color: #555; 
  border: 1px dashed #ccc; 
  font-weight: 500;
}

.btn-personal {
  background: #5A4AF0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(90, 74, 240, 0.25);
}

.auth-divider-thin {
  height: 1px;
  background: #cfc4a9;
  margin: 16px 0;
  width: 100%;
}

@media (min-width: 600px) {
  .auth-btn {
    height: 57px;
    grid-template-columns: 56px 1fr;
    padding-right: 16px;
  }

  .main-providers {
    grid-template-columns: 1fr 1fr;
  }
  .eval-providers {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-remember-container {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #494238;
  font-weight: 500;
}

.auth-error-msg {
  display: none;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #FFF1F0;
  color: #D93025;
  font-size: 13px;
  text-align: center;
  font-weight: 500;
  border: 1px solid #FCE8E6;
}

.auth-sim-container {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.auth-sim-btn {
  background: rgba(79, 154, 67, 0.08);
  border: 1px dashed rgba(79, 154, 67, 0.4);
  color: #4f9a43;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.auth-sim-btn span {
  opacity: 0.85;
}

.auth-sim-btn:hover {
  background: rgba(79, 154, 67, 0.12);
  border-style: solid;
  border-color: rgba(79, 154, 67, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(79, 154, 67, 0.12);
}

.auth-sim-btn:hover span {
  opacity: 1;
}

.auth-sim-btn:active {
  transform: translateY(0);
  background: rgba(79, 154, 67, 0.18);
}

.auth-footer {
  padding: 16px 32px 24px;
  text-align: center;
  font-size: 12px;
  color: #6c6458;
  font-weight: 500;
  background: #ddd7c3;
  border-top: 2px solid #4f9a43;
}

.auth-footer a {
  color: #4b463b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Interactive Loading UX Styles */
.auth-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  text-align: center;
  pointer-events: none; /* Let clicks pass through to overlay for star effects */
}

/* Ensure interactive elements inside panel can be clicked */
.auth-loading-panel button, 
.auth-loading-panel a {
  pointer-events: auto;
}

.auth-loading-panel .auth-btn {
  font-size: calc(18px * var(--instruction-scale));
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(90, 74, 240, 0.2);
  border-top-color: #5A4AF0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

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

.loading-title {
  font-size: calc(22px * var(--instruction-scale));
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.loading-message-box {
  background: rgba(255, 255, 255, 0.85);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  max-width: 320px;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

#loadingMessageText {
  font-size: calc(15px * var(--instruction-scale));
  line-height: 1.5;
  color: #444;
  margin: 0 0 12px 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.loading-click-hint {
  font-size: calc(12px * var(--instruction-scale));
  color: #888;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.star-effect {
  font-size: calc(14px * var(--instruction-scale));
  animation: pulse-star 1.5s infinite ease-in-out;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

.auth-fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(230, 170, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.1);
  padding: 16px;
  text-align: center;
  font-size: calc(14px * 1.3);
  color: #fff;
  z-index: 10001;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
  transition: background 0.2s;
}

.auth-fixed-footer:hover {
  background: rgba(210, 155, 0, 0.98);
}

.auth-fixed-footer a {
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.6);
  text-underline-offset: 3px;
  display: inline-block;
  margin-top: 4px;
}

.mouse-star {
  position: fixed;
  font-size: 20px;
  pointer-events: none;
  z-index: 99999;
  animation: float-up-fade 0.8s forwards ease-out;
}

@keyframes float-up-fade {
  0% { transform: translateY(0) scale(0.5) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-40px) scale(1.5) rotate(45deg); opacity: 0; }
}

/* Temporary override: Hide instructions to show Lottie instead */
.auth-loading-panel, 
.auth-fixed-footer {
  display: none !important;
}

.auth-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 19, 0.34);
  backdrop-filter: blur(2px);
}
.auth-feedback-card {
  position: relative;
  width: min(440px, 88vw);
  background: #f2eddf;
  border: 1px solid rgba(85, 121, 64, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  padding: 24px 20px 18px;
  text-align: center;
}
.auth-feedback-title { margin: 0 0 10px; font-size: 22px; color: #2a3721; }
.auth-feedback-desc { margin: 0 0 16px; color: #4b5840; font-size: 14px; font-weight: 600; }
.auth-feedback-confirm {
  border: 1px solid #4f9a43;
  background: #dfead1;
  color: #2d4f25;
  border-radius: 12px;
  min-width: 120px;
  height: 40px;
  font-weight: 700;
  cursor: pointer;
}
