
/* ==========================================
   Global Reset & Base Styles
   ========================================== */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  
  background-size: cover;
  background-attachment: fixed;
}




/* 1) استقرار عام */
html {
  box-sizing: border-box;
  scrollbar-gutter: stable both-edges; /* يمنع اختلاف العرض بسبب شريط التمرير */
}


@media (max-width: 768px) {
  /* حماية من التمايل الأفقي بسبب 100vw أو سكروول */
  html, body { max-width: 100%; overflow-x: hidden; }


  /* 4) منع تكبير النص التلقائي على iOS */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

}








/* ==========================================
   Main Navbar – Global Style (Relative Units)
   ========================================== */
/* ===== Desktop (≥768px) ===== */
@media (min-width: 48em) {

 .main-nav {
  display: flex;
  justify-content: space-between;  /* Pastura يسار / USA يمين */
  align-items: center;             /* محاذاة عمودية وسط */
  padding: 1vh 2vw;
  background-color: rgba(34, 68, 40, 0.85);
  height: 10vh;                    /* شريط مرن */
  box-shadow: 0 .2vh .8vh rgba(64, 105, 66, 0.1);
  position: fixed;
  top: 0;
   left: 0;
  width: 100%;
  z-index: 3000;
  box-sizing: border-box;
}

  .nav-links ul {
    display: flex;
    gap: 2vw;
    list-style: none;
    margin: 0;
    padding: 0;
  }

 .main-nav a {
  flex: 0 1 auto;                     /* يسمح لها بالتقلص */
  font-weight: 700;
  text-decoration: none;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: #fff;
  padding: clamp(0.4rem, 1vh, 0.6rem) clamp(0.8rem, 2vw, 1.2rem);
  background: #7d807d;
  border-radius: 0.5rem;
  white-space: nowrap;                /* ما يتكسر النص */
  max-width: 45%;                     /* نصف عرض الشريط تقريبًا */
  overflow: hidden;                   /* يخفي النص الزايد */
  text-overflow: ellipsis;            /* يضيف … إذا صار النص طويل */
}


  .main-nav a:hover { color: #ffd5d5; }
}

/* ===== Mobile (≤767px) ===== */
@media (max-width: 47.9em) {
 .main-nav {
  display: flex;
  justify-content: space-between;  /* Pastura يسار / USA يمين */
  align-items: center;             /* محاذاة عمودية وسط */
  padding: 1vh 2vw;
  background-color: rgba(128, 139, 130, 0.8);
  height: 10vh;                    /* شريط مرن */
  box-shadow: 0 .2vh .8vh rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
   left: 0;
  width: 100%;
  z-index: 3000;
  box-sizing: border-box;
}






  .nav-links ul {
    display: flex;
    gap: 4vw; /* فراغ أكبر للموبايل */
    list-style: none;
    margin: 0;
    padding: 0;
  }

 .main-nav a {
  flex: 0 1 auto;                     /* يسمح لها بالتقلص */
  font-weight: 700;
  text-decoration: none;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: #fff;
  padding: clamp(0.4rem, 1vh, 0.6rem) clamp(0.8rem, 2vw, 1.2rem);
  background: #233f3a;
  border-radius: 0.5rem;
  white-space: nowrap;                /* ما يتكسر النص */
  max-width: 45%;                     /* نصف عرض الشريط تقريبًا */
  overflow: hidden;                   /* يخفي النص الزايد */
  text-overflow: ellipsis;            /* يضيف … إذا صار النص طويل */
}


  .main-nav a:hover { color: #ffd5d5; }
}


.auth-section {
  max-width: 700px; margin-top: 18vh auto; padding: 2rem; background-color: #ebe8e8 !important;
  border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
}





/* =========================
   Pastura - Security View
   ========================= */

#view-security.auth-view{
  padding: 18px;
  max-width: 920px;
  margin: 0 auto;






  
}

.sec-header h2{
  margin: 0 0 6px;
  font-size: 1.6rem;
  letter-spacing: .2px;
}

.sec-muted{
  opacity: .82;
  margin: 0;
  line-height: 1.45;
}

.sec-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Card */
.sec-card{
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  backdrop-filter: blur(6px);
}

.sec-card-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sec-card h3{
  margin: 0;
  font-size: 1.05rem;
}

.sec-pill{
  font-size: .78rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(19,49,19,.08); /* قريب من أخضر Pastura */
  opacity: .9;
  white-space: nowrap;
}

/* Buttons */
.sec-btn{
  margin-top: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  background: rgba(255,255,255,.92);
  cursor: pointer;
  font-weight: 600;
  transition: transform .06s ease, box-shadow .12s ease, opacity .12s ease;
}

.sec-btn:hover{
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}

.sec-btn:active{
  transform: translateY(1px);
}

.sec-btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Danger card/button */
.sec-card-danger{
  border-color: rgba(204,86,7,.35); /* قريب من #cc5607cc */
  background: rgba(204,86,7,.06);
}

.sec-btn-danger{
  border-color: rgba(204,86,7,.45);
  background: rgba(204,86,7,.10);
}

/* Notes + message */
.sec-note{
  margin: 10px 0 0;
  font-size: .92rem;
  opacity: .78;
}

.sec-msg{
  margin-top: 12px;
  opacity: .9;
  min-height: 18px;
}

/* Responsive: wider screens */
@media (min-width: 860px){
  .sec-grid{
    grid-template-columns: 1.2fr .8fr;
    align-items: start;
  }
  /* session card full width on bottom */
  .sec-card-danger{
    grid-column: 1 / -1;
  }
}











.auth-view {
  position: relative;
  top: 14vh;
}











/* Profile extras */
.profile-row{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(0,0,0,.08);
}

.profile-row:first-of-type{
  border-top: none;
}

.profile-label{
  font-weight: 600;
  opacity: .8;
}

.profile-value{
  opacity: .95;
  word-break: break-word;
}

.profile-input{
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  background: rgba(255,255,255,.92);
  outline: none;
}

.profile-input:focus{
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  border-color: rgba(19,49,19,.25);
}

@media (max-width: 520px){
  .profile-row{
    grid-template-columns: 1fr;
  }
}
