
*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Arial,sans-serif;
}

:root{
--bg:#080808;
--bg2:#111;
--card:#121212;
--text:#eee;
--muted:#aaa;
--border:#4d2b63;
--accent:#c38cff;
--accent2:#d0a2ff;
--hover:#4b2367;
--shadow:0 0 8px rgba(138,43,226,.20);
}

body{
background:var(--bg);
color:var(--text);
line-height:1.6;
overflow-x:hidden;
}

/* =========================
   GLOBAL
========================= */
a{
text-decoration:none;
color:#ddd;
font-weight:600;
transition:.3s;
}

a:hover{
background:var(--hover);
box-shadow:0 0 8px rgba(138,43,226,.25);
}

img{
max-width:100%;
display:block;
}

ul{
list-style:none;
}

/* =========================
   HEADER
========================= */
header,
.posts-header{
display:flex;
flex-direction:column;
gap:14px;
padding:20px 8%;
background:var(--bg2);
border-bottom:1px solid var(--border);
box-shadow:var(--shadow);
position:sticky;
top:0;
z-index:1000;
}

.top-bar{
display:flex;
justify-content:space-between;
align-items:center;
gap:15px;
width:100%;
}

.logo-link,
header > a{
text-decoration:none;
}

h1,
.logo-link h1{
font-size:28px;
color:var(--accent);
text-shadow:0 0 6px rgba(138,43,226,.35);
}

/* =========================
   NAVIGATION
========================= */
.main-menu,
.mobile-menu{
display:flex;
justify-content:space-between;
align-items:center;
gap:20px;
flex-wrap:wrap;
width:100%;
}

.main-menu li,
.mobile-menu li,
header li{
display:flex;
gap:14px;
flex-wrap:wrap;
align-items:center;
}

.main-menu a,
.mobile-menu a,
header a{
padding:8px 14px;
border-radius:8px;
}

/* =========================
   MENU BUTTON
========================= */
.menu-toggle{
display:none;
background:#1a1a1a;
color:#fff;
border:1px solid var(--border);
padding:8px 14px;
border-radius:10px;
font-size:22px;
cursor:pointer;
transition:.3s;
}

.menu-toggle:hover{
background:var(--hover);
}

/* =========================
   SEARCH
========================= */
.search-box,
.posts-search-wrap{
width:100%;
}

.search-box input,
.posts-search-wrap input{
width:100%;
padding:12px 14px;
border:none;
outline:none;
border-radius:12px;
background:#1a1a1a;
color:#fff;
border:1px solid var(--border);
font-size:15px;
}

.search-box input:focus,
.posts-search-wrap input:focus{
box-shadow:0 0 8px rgba(138,43,226,.25);
}

/* =========================
   LANGUAGE
========================= */
.lang-switcher{
display:flex;
gap:8px;
align-items:center;
flex-wrap:wrap;
}

.lang-switcher a{
padding:8px 10px;
font-size:14px;
background:#1a1a1a;
border:1px solid var(--border);
border-radius:8px;
color:#ddd;
}

/* =========================
   HERO
========================= */
.hero{
padding:90px 8%;
}

.hero h2{
font-size:clamp(32px,5vw,54px);
margin-bottom:20px;
color:var(--accent2);
text-shadow:0 0 8px rgba(138,43,226,.25);
}

.hero p{
max-width:700px;
font-size:clamp(16px,2vw,20px);
color:var(--muted);
}

/* =========================
   POSTS GRID
========================= */
.posts{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
gap:30px;
padding:50px 8%;
}

/* =========================
   ARTICLE CARD
========================= */
.article-card{
display:flex;
flex-direction:column;
background:var(--card);
border-radius:18px;
overflow:hidden;
border:1px solid var(--border);
transition:.3s;
}

.article-card:hover{
transform:translateY(-6px);
box-shadow:0 0 12px rgba(138,43,226,.20);
}

.card-title{
background:var(--hover);
padding:16px;
font-size:20px;
font-weight:bold;
color:#fff;
}

.card-preview{
padding:22px;
min-height:140px;
color:#bbb;
line-height:1.8;
}

.card-image{
aspect-ratio:16/9;
overflow:hidden;
}

.card-image img{
width:100%;
height:100%;
object-fit:cover;
}

/* =========================
   POST PAGE
========================= */
.post-page{
padding:60px 8%;
max-width:1000px;
margin:auto;
}

.post-page h1{
font-size:42px;
line-height:1.3;
margin-bottom:12px;
color:#fff;
word-break:break-word;
}

.post-meta{
color:#999;
font-size:15px;
margin-bottom:20px;
}

.post-image{
width:100%;
aspect-ratio:16/9;
overflow:hidden;
border-radius:18px;
margin:25px 0;
background:#111;
}

.post-image img{
width:100%;
height:100%;
object-fit:cover;
object-position:center;
}

.post-content{
font-size:18px;
line-height:1.95;
color:#ddd;
word-break:break-word;
overflow-wrap:break-word;
}

.post-content *{
max-width:100%;
}

.post-content img{
height:auto;
margin:20px auto;
border-radius:14px;
}

/* =========================
   FOOTER
========================= */
.site-footer{
margin-top:60px;
padding:30px 8%;
background:var(--bg2);
border-top:1px solid var(--border);
text-align:center;
color:#aaa;
}

.footer-links{
margin-top:12px;
display:flex;
justify-content:center;
gap:20px;
flex-wrap:wrap;
}

/* =========================
   ADS
========================= */
.ad-slot,
.bottom-ad{
display:none;
}

.ad-slot.active{
display:flex;
position:fixed;
right:20px;
top:50%;
transform:translateY(-50%);
width:180px;
min-height:300px;
background:var(--card);
border:1px solid var(--border);
border-radius:12px;
justify-content:center;
align-items:center;
padding:10px;
z-index:999;
}

.bottom-ad.active{
display:flex;
position:fixed;
bottom:0;
left:50%;
transform:translateX(-50%);
width:min(95%,900px);
min-height:90px;
background:var(--card);
border-top:1px solid var(--border);
justify-content:center;
align-items:center;
padding:10px;
z-index:999;
}

/* =========================
   TABLET
========================= */
@media(max-width:768px){

header,
.posts-header{
padding:18px 5%;
}

.menu-toggle{
display:block;
}

.main-menu,
.mobile-menu{
display:none;
flex-direction:column;
align-items:stretch;
gap:14px;
}

.main-menu.active,
.mobile-menu.active{
display:flex;
}

.main-menu li,
.mobile-menu li,
header li{
flex-direction:column;
gap:10px;
width:100%;
}

.main-menu a,
.mobile-menu a,
header a{
width:100%;
text-align:center;
}

h1,
.logo-link h1{
font-size:24px;
text-align:center;
}

.lang-switcher{
justify-content:center;
}

.lang-switcher a{
min-width:60px;
text-align:center;
}

.hero{
padding:70px 5%;
text-align:center;
}

.hero p{
margin:auto;
}

.posts{
grid-template-columns:1fr;
padding:35px 5%;
}

.post-page{
padding:30px 16px;
}

.post-page h1{
font-size:28px;
}

.post-meta{
font-size:14px;
}

.post-image{
aspect-ratio:4/3;
border-radius:14px;
}

.post-content{
font-size:16px;
line-height:1.9;
}

.ad-slot.active{
display:none;
}

.bottom-ad.active{
width:100%;
border-radius:0;
}

}

/* =========================
   MOBILE
========================= */
@media(max-width:480px){

.post-page h1{
font-size:24px;
}

.post-content{
font-size:15px;
line-height:1.8;
}

.footer-links{
flex-direction:column;
gap:10px;
}

.posts-search-wrap input,
.search-box input{
font-size:14px;
padding:11px 12px;
}

.menu-toggle{
font-size:20px;
padding:7px 12px;
}

}
/* =========================
   AUTH & MODAL STYLES
========================= */
.auth-status {
  display: flex;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 14px;
  color: var(--accent);
  background: rgba(195, 140, 255, 0.15);
  padding: 5px 10px;
  border-radius: 20px;
}

.auth-btn {
  background: var(--hover);
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  transition: 0.3s;
  font-weight: 600;
}

.auth-btn:hover {
  background: #6b2e9e;
  transform: scale(1.02);
}

.signout-btn {
  background: #3a1a4f;
}

/* Modal */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
}

.custom-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 90%;
  max-width: 450px;
  padding: 24px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  color: var(--accent);
  font-size: 22px;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  margin-bottom: 24px;
  color: var(--text);
  line-height: 1.6;
}

.modal-question,
.modal-message {
  font-size: 17px;
  text-align: center;
  margin: 15px 0;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 40px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.modal-btn.btn-primary {
  background: var(--accent);
  color: #000;
}

.modal-btn.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

.modal-btn.btn-secondary {
  background: #2a2a2a;
  color: #ddd;
}

.modal-btn.btn-secondary:hover {
  background: #3a3a3a;
}

.modal-btn.btn-google {
  background: #4285f4;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-btn.btn-google:hover {
  background: #5a95f5;
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
  padding: 40px 8%;
  /* كل الصفوف بنفس الارتفاع — المفتاح لتناسق البطاقات */
  grid-auto-rows: 1fr;
  align-items: stretch;
}

.book-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: 0.3s;
  cursor: pointer;
  /* flex لتوزيع المحتوى — الغلاف ثابت والـ info تملأ الباقي */
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(138, 43, 226, 0.25);
}

.book-cover {
  /* نسبة ثابتة للغلاف في كل البطاقات */
  aspect-ratio: 2/3;
  overflow: hidden;
  flex-shrink: 0;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.4s;
}

.book-card:hover .book-cover img {
  transform: scale(1.03);
}

.book-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;            /* تأخذ المساحة المتبقية */
  gap: 6px;
}

.book-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--accent2);
  /* 2 سطر فقط — أي عنوان مهما كان طوله */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.book-short-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  /* 3 أسطر فقط */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;   /* يدفعه للأسفل */
}

/* Book Detail Page */
.book-detail-page {
  padding: 50px 8%;
  max-width: 900px;
  margin: 0 auto;
}

.book-cover-full {
  max-width: 280px;
  margin: 0 auto 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.book-full-description {
  margin: 30px 0;
  line-height: 1.9;
  color: #ccc;
}

.download-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  border: none;
  padding: 14px 35px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
  display: inline-block;
  margin-top: 20px;
  width: 100%;
  max-width: 280px;
}

.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(195, 140, 255, 0.4);
}

@media (max-width: 768px) {
  .books-grid {
    padding: 30px 5%;
    gap: 25px;
  }
  
  .book-detail-page {
    padding: 30px 5%;
  }
}

#pdf-viewer {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  background: #000;
}

#pdf-frame {
  width: 100%;
  min-height: 70vh;
  border: none;
}

/* =========================
   STATS SECTION
========================= */
.stats-section {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0 8% 60px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 40px;
  min-width: 150px;
  transition: 0.3s;
  box-shadow: var(--shadow);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 16px rgba(138, 43, 226, 0.25);
}

.stat-number {
  font-size: 42px;
  font-weight: bold;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* =========================
   SUGGESTIONS SECTION
========================= */
.suggestions-section {
  padding: 20px 0 60px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.suggestions-title {
  font-size: 26px;
  color: var(--accent2);
  padding: 30px 8% 10px;
}

/* Suggested books grid — narrower cards than the main grid */
.suggestions-books-grid {
  padding: 20px 8% 0;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  grid-auto-rows: 1fr;
}

@media (max-width: 768px) {
  .stats-section {
    gap: 16px;
    padding: 0 5% 50px;
  }

  .stat-box {
    padding: 22px 28px;
    min-width: 120px;
  }

  .stat-number {
    font-size: 34px;
  }

  .suggestions-title {
    padding: 24px 5% 8px;
    font-size: 22px;
  }

  .suggestions-books-grid {
    padding: 16px 5% 0;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .stat-box {
    padding: 18px 22px;
    min-width: 100px;
  }

  .stat-number {
    font-size: 28px;
  }

  .stat-label {
    font-size: 12px;
  }
}

/* =========================
   BOOKS PAGE HEADER
========================= */
.books-page-header {
  padding: 36px 8% 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.books-main-heading {
  font-size: clamp(22px, 4vw, 32px);
  color: var(--accent2);
}

/* ── Search ── */
.books-search-wrap {
  width: 100%;
  max-width: 520px;
}

.books-search-input {
  width: 100%;
  padding: 12px 16px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: box-shadow .25s;
}

.books-search-input:focus {
  box-shadow: 0 0 10px rgba(138,43,226,.3);
}

/* ── Category chips ── */
.books-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #1a1a1a;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: .25s;
  text-transform: capitalize;
  white-space: nowrap;
}

.category-chip:hover,
.category-chip.active {
  background: var(--hover);
  color: var(--accent2);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(138,43,226,.2);
}

/* ── Empty state ── */
.books-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 16px;
}

/* ── Book category tags (inside card) ── */
.book-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.book-cat-tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(195,140,255,.12);
  color: var(--accent);
  border: 1px solid rgba(195,140,255,.25);
  text-transform: capitalize;
  white-space: nowrap;
}

/* =========================
   MOBILE — BOOKS PAGE
========================= */
@media (max-width: 768px) {
  .books-page-header {
    padding: 24px 5% 0;
    gap: 14px;
  }

  .books-search-wrap {
    max-width: 100%;
  }

  .books-search-input {
    font-size: 14px;
    padding: 11px 14px;
  }

  .category-chip {
    font-size: 12px;
    padding: 5px 12px;
  }

  .books-grid {
    padding: 20px 5%;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }

  .book-info {
    padding: 10px;
  }

  .book-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .book-short-desc {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 4%;
  }

  .book-title {
    font-size: 12px;
  }

  .book-short-desc {
    display: none; /* إخفاء الوصف كلياً على الشاشات الصغيرة جداً */
  }

  .book-cat-tag {
    font-size: 10px;
    padding: 2px 7px;
  }

  /* صفحة كتاب واحد على الموبايل */
  .book-detail-page {
    padding: 20px 4%;
  }

  .book-cover-full {
    max-width: 180px;
  }

  .book-title-full {
    font-size: 22px;
    text-align: center;
  }

  .book-full-description {
    font-size: 14px;
    line-height: 1.8;
  }

  .download-btn {
    font-size: 15px;
    padding: 12px 24px;
    max-width: 100%;
  }

  #pdf-frame {
    min-height: 55vh;
  }

  /* الكتب المقترحة على موبايل */
  .suggestions-books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 4% 0;
  }

  .suggestions-title {
    font-size: 18px;
    padding: 20px 4% 8px;
  }
}

/* =========================
   PAGINATION
========================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 30px 8% 60px;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: .2s;
  white-space: nowrap;
}

.pg-btn:hover:not(.disabled):not(.active) {
  background: var(--hover);
  color: var(--accent2);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(138,43,226,.2);
  transform: none;
}

.pg-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  cursor: default;
}

.pg-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pg-arrow {
  font-size: 18px;
  padding: 0 14px;
}

.pg-ellipsis {
  color: var(--muted);
  padding: 0 4px;
  font-size: 16px;
  line-height: 40px;
}

/* عدد النتائج */
.books-count {
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
}

@media (max-width: 480px) {
  .pagination {
    padding: 20px 4% 40px;
    gap: 5px;
  }

  .pg-btn {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
    padding: 0 8px;
  }

  .pg-arrow {
    padding: 0 10px;
  }
}

/* =========================
   LEGAL PAGE (about / privacy / cookies)
========================= */
.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 8% 80px;
}

.legal-hero {
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.legal-hero h1 {
  font-size: clamp(20px, 3.5vw, 30px);
  color: var(--accent2);
  line-height: 1.4;
  margin-bottom: 16px;
}

.legal-intro {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.legal-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  transition: box-shadow .25s;
}

.legal-section:hover {
  box-shadow: 0 0 14px rgba(138,43,226,.12);
}

.legal-section > h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(77,43,99,.5);
}

.legal-section > p {
  color: #ccc;
  font-size: 14px;
  line-height: 1.85;
}

.legal-subsection {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(77,43,99,.35);
}

.legal-subsection:first-of-type {
  margin-top: 8px;
}

.legal-subsection h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 8px;
}

.legal-subsection p {
  color: #bbb;
  font-size: 14px;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .legal-page {
    padding: 36px 5% 60px;
  }

  .legal-section {
    padding: 20px 18px;
  }

  .legal-hero h1 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .legal-page {
    padding: 24px 4% 50px;
  }

  .legal-section {
    padding: 16px 14px;
    border-radius: 12px;
  }

  .legal-section > h2 {
    font-size: 15px;
  }

  .legal-subsection h3,
  .legal-section > p,
  .legal-subsection p {
    font-size: 13px;
  }
}

/* =========================
   AUTH MODAL & FORMS
========================= */
.auth-modal-container {
  max-width: 480px;
  width: 92vw;
}

.auth-modal-body {
  padding: 4px 0 0;
}

/* Form layout */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.auth-field input {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 11px 14px;
  font-size: 15px;
  outline: none;
  transition: box-shadow .2s;
  width: 100%;
}

.auth-field input:focus {
  box-shadow: 0 0 0 2px rgba(195,140,255,.35);
  border-color: var(--accent);
}

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

.auth-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 6px;
  transition: .2s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(195,140,255,.35);
}

.auth-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.auth-error {
  background: rgba(255,60,60,.12);
  border: 1px solid rgba(255,60,60,.35);
  color: #ff7070;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  padding: 0 4px;
  text-decoration: underline;
}

.auth-step-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.optional { color: var(--muted); font-weight: 400; }
.required { color: #ff7070; }

/* Avatar upload */
.avatar-upload {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  background: #1a1a1a;
  transition: border-color .2s;
}

.avatar-upload:hover { border-color: var(--accent); }

#avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Interests grid */
.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.interest-chip {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #1a1a1a;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  text-transform: capitalize;
}

.interest-chip.selected,
.interest-chip:hover {
  background: var(--hover);
  color: var(--accent2);
  border-color: var(--accent);
}

/* Header auth avatar */
.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.auth-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hover);
  color: var(--accent2);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
}

/* Profile view */
.profile-view { display: flex; flex-direction: column; gap: 20px; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--hover);
  color: var(--accent2);
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}

.profile-fullname { font-size: 18px; font-weight: 700; color: #fff; }
.profile-username { font-size: 13px; color: var(--accent); }
.profile-email    { font-size: 12px; color: var(--muted); }

.profile-section { }
.profile-label {
  font-size: 12px; color: var(--muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 8px;
}

.profile-actions {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.profile-actions .auth-btn {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .auth-row { grid-template-columns: 1fr; }
  .auth-modal-container { padding: 16px; }
}

/* =========================
   GOOGLE SIGN-IN BUTTON & DIVIDER
========================= */
.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 12px;
  cursor: pointer;
  transition: .2s;
  margin-top: 4px;
}

.auth-google-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transform: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
