/* ===== AUTH / PROFILE MODE LAYOUT FIX ===== */

/* When profile panel is open, hide simulator controls/layout */
body:has(#profilePanel:not(.hidden-panel)) .top-controls,
body:has(#profilePanel:not(.hidden-panel)) .subbar,
body:has(#profilePanel:not(.hidden-panel)) main.layout {
  display: none !important;
}

/* Hide full topbar when auth/profile panel is open */
body:has(#profilePanel:not(.hidden-panel)) .topbar {
  display: none !important;
}

/* Full-screen auth/profile overlay */
#profilePanel:not(.hidden-panel) {
  position: fixed;
  inset: 0;
  z-index: 40;

  display: flex !important;
  align-items: center;
  justify-content: center;

  padding: 32px 16px;
  background: #f3f4f6;
  overflow: auto;
}

/* Center card */
#profilePanel:not(.hidden-panel) .profile-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* Main white card */
#profilePanel:not(.hidden-panel) .profile-card {
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
  padding: 28px 28px 24px 28px;
  border-top: 4px solid #6d5efc;
}

/* Header */
#profilePanel:not(.hidden-panel) .profile-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

#profilePanel:not(.hidden-panel) .profile-title {
  font-size: 30px;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
}

#profilePanel:not(.hidden-panel):has(#forgotPasswordBox:not(.hidden-panel)) .profile-title {
  transform: translateX(-40px);
}

#profilePanel:not(.hidden-panel) #closeProfileBtn {
  position: absolute;
  right: 0;
  top: 0;
}

#profilePanel:not(.hidden-panel) #cancelChangePasswordBtn {
  position: absolute;
  left: 0;
  top: 0;
}

#profilePanel:not(.hidden-panel):has(#changePasswordBox:not(.hidden-panel)) #cancelChangePasswordBtn {
  display: inline-block !important;
}

/* Form layout */
#profilePanel:not(.hidden-panel) .profile-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#profilePanel:not(.hidden-panel) .profile-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#profilePanel:not(.hidden-panel) .profile-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

#profilePanel:not(.hidden-panel) .profile-row input {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  outline: none;
}

#profilePanel:not(.hidden-panel) .profile-row input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

/* Buttons */
#profilePanel:not(.hidden-panel) .profile-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

#profilePanel:not(.hidden-panel) #loginSubmitBtn,
#profilePanel:not(.hidden-panel) #saveProfileBtn {
  width: 100%;
  max-width: 520px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid #12979a;
  background: #12979a;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

#profilePanel:not(.hidden-panel) #closeProfileBtn {
  min-width: 110px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
}

#profilePanel:not(.hidden-panel) #cancelChangePasswordBtn {
  min-width: 110px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Auth Tabs ===== */
#profilePanel:not(.hidden-panel) .auth-switch{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 18px auto;
  border: 1px solid #12979a;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

#profilePanel:not(.hidden-panel) .auth-tab{
  height: 46px;
  border: 0;
  background: #fff;
  color: #374151;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}

#profilePanel:not(.hidden-panel) .auth-tab.active{
  background: #12979a;
  color: #fff;
}

.error-msg {
  color: #ef4444;
  font-size: 13px;
  margin-top: 4px;
}

/* ===== Logged-out auth page: left info + right login card ===== */
#profilePanel:not(.hidden-panel) .profile-shell{
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(620px, 760px) minmax(420px, 520px);
  gap: 40px;
  align-items: center;
  transform: translateX(-80px);
}

#profilePanel:not(.hidden-panel) .auth-info-box{
  display: block;
  max-width: 560px;
}

#profilePanel:not(.hidden-panel) .auth-info-chip{
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f8b8d;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}

#profilePanel:not(.hidden-panel) .auth-info-title{
  margin: 0 0 14px 0;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 800;
  color: #0f172a;
}

#profilePanel:not(.hidden-panel) .auth-info-text{
  margin: 0 0 18px 0;
  font-size: 18px;
  line-height: 1.7;
  color: #475569;
  max-width: 620px;
}

#profilePanel:not(.hidden-panel) .auth-info-line{
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #0f766e;
  font-weight: 700;
}

#profilePanel:not(.hidden-panel) .auth-info-points{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#profilePanel:not(.hidden-panel) .auth-info-point{
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

#profilePanel:not(.hidden-panel) .profile-card{
  width: 100%;
  max-width: 520px;
  margin-left: auto;
}

/* Mobile: stack info above login */
@media (max-width: 900px){
  #profilePanel:not(.hidden-panel) .profile-shell{
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 560px;
  }

  #profilePanel:not(.hidden-panel) .auth-info-box{
    max-width: 100%;
  }

  #profilePanel:not(.hidden-panel) .auth-info-title{
    font-size: 34px;
  }

  #profilePanel:not(.hidden-panel) .auth-info-text{
    font-size: 16px;
  }

  #profilePanel:not(.hidden-panel) .profile-card{
    max-width: 100%;
    margin-left: 0;
  }
}

/* Hide left marketing/info box when My Profile is open */
#profilePanel:not(.hidden-panel):has(#myProfileBox:not(.hidden-panel)) .auth-info-box,
#profilePanel:not(.hidden-panel):has(#changePasswordBox:not(.hidden-panel)) .auth-info-box{
  display: none !important;
}

/* In My Profile mode, show only one centered card */
#profilePanel:not(.hidden-panel):has(#myProfileBox:not(.hidden-panel)) .profile-shell,
#profilePanel:not(.hidden-panel):has(#changePasswordBox:not(.hidden-panel)) .profile-shell{
  grid-template-columns: 1fr !important;
  max-width: 560px !important;
}

#profilePanel:not(.hidden-panel):has(#myProfileBox:not(.hidden-panel)) .profile-card,
#profilePanel:not(.hidden-panel):has(#changePasswordBox:not(.hidden-panel)) .profile-card{
  margin-left: 0 !important;
  max-width: 100% !important;
}

/* ===== Logout / auth info hero card polish ===== */
#profilePanel:not(.hidden-panel) .auth-info-box{
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.08);
  padding: 36px;
  width: 100%;
  max-width: 620px;
  margin-left: 0;
}

#profilePanel:not(.hidden-panel) .auth-info-chip{
  display: inline-block;
  background: #ecfeff;
  color: #0f8b8d;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}

#profilePanel:not(.hidden-panel) .auth-info-title{
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
}

#profilePanel:not(.hidden-panel) .auth-info-text{
  margin: 0 0 24px;
  font-size: 17px;
  color: #475569;
  line-height: 1.7;
  max-width: 760px;
}

#profilePanel:not(.hidden-panel) .auth-info-line{
  margin-bottom: 20px;
  font-size: 14px;
  color: #0f766e;
  font-weight: 600;
}

#profilePanel:not(.hidden-panel) .auth-info-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

#profilePanel:not(.hidden-panel) .auth-info-terms-btn{
  text-decoration: none;
  background: #fff;
  color: #0f8b8d;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  display: inline-block;
}

#profilePanel:not(.hidden-panel) .auth-info-cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

#profilePanel:not(.hidden-panel) .auth-info-card{
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
  padding: 24px;
}

#profilePanel:not(.hidden-panel) .auth-info-card-title{
  font-size: 14px;
  font-weight: 800;
  color: #0f8b8d;
  margin-bottom: 10px;
}

#profilePanel:not(.hidden-panel) .auth-info-card-text{
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
}

@media (max-width: 900px){
  #profilePanel:not(.hidden-panel) .auth-info-box{
    padding: 28px 22px;
    border-radius: 18px;
  }

  #profilePanel:not(.hidden-panel) .auth-info-title{
    font-size: 34px;
  }

  #profilePanel:not(.hidden-panel) .auth-info-text{
    font-size: 16px;
  }

    #profilePanel:not(.hidden-panel) .auth-info-cards{
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
  }

  #profilePanel:not(.hidden-panel) .auth-info-card{
    padding: 20px;
    border-radius: 16px;
  }

  #profilePanel:not(.hidden-panel) .auth-info-card-text{
    font-size: 14px;
  }
}
