/* ============================================================
   Oikosa — Üyelik / Giriş (auth) ve profil menüsü
   Tüm sayfalarda ortak. Tasarım dili style.css ile birebir.
   ============================================================ */

/* ----- Overlay + kart ----- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(26,30,28,.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity .18s ease;
}
.auth-overlay.open { display: flex; opacity: 1; }

.auth-card {
  background: var(--surface); border-radius: var(--r-xl);
  width: 100%; max-width: 432px; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.985); transition: transform .2s ease;
}
.auth-overlay.open .auth-card { transform: none; }

.auth-head { padding: 26px 28px 0; position: relative; }
.auth-brand { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.auth-brand .dot { color: var(--teal-2); }
.auth-title { font-family: var(--serif); font-size: 21px; font-weight: 600; margin-top: 14px; }
.auth-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.auth-close {
  position: absolute; top: 20px; right: 20px;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: 19px;
  transition: background .15s;
}
.auth-close:hover { background: var(--surface-3); }

.auth-body { padding: 20px 28px 28px; }

/* ----- Tab geçişi (Giriş / Üye ol) ----- */
.auth-seg {
  display: flex; gap: 4px; background: var(--surface-2);
  padding: 5px; border-radius: var(--r-pill); margin-bottom: 22px;
}
.auth-seg button {
  flex: 1; padding: 10px 0; font-size: 14px; font-weight: 600; font-family: inherit;
  border-radius: var(--r-pill); color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.auth-seg button.active { color: var(--teal); } /* zemin kayan pill'de (style.css .auth-seg::before) */

/* ----- Google butonu ----- */
.auth-google {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s;
}
.auth-google:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); }
.auth-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ----- Apple butonu ----- */
.auth-apple {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-sm);
  background: #000; color: #fff; font-size: 14.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s, box-shadow .15s; border: none;
}
.auth-apple:hover { background: #222; box-shadow: var(--shadow-sm); }
.auth-apple svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ----- Sosyal giriş grubu ----- */
.auth-social-group { display: flex; flex-direction: column; gap: 10px; }

/* ----- Giriş yöntemi sekmeleri (e-posta / telefon) ----- */
.auth-login-tabs {
  display: flex; gap: 4px; background: var(--surface-2);
  padding: 4px; border-radius: var(--r-sm); margin-bottom: 4px;
}
.auth-login-tabs button {
  flex: 1; padding: 8px 0; font-size: 13px; font-weight: 600; font-family: inherit;
  border-radius: 8px; color: var(--ink-3); cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none;
}
.auth-login-tabs button.active { color: var(--teal); } /* zemin kayan pill'de (style.css .auth-login-tabs::before) */
.auth-login-tabs button i { font-size: 15px; }

.auth-or { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-or span { font-size: 12.5px; color: var(--ink-3); }

/* ----- Form alanları ----- */
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.auth-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.auth-input::placeholder { color: var(--ink-4); }
.auth-input:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(15,110,86,.12); outline: none; }

/* Telefon: +90 önekli */
.auth-phone { display: flex; align-items: stretch; }
.auth-phone .pre {
  display: inline-flex; align-items: center; padding: 0 12px;
  border: 1.5px solid var(--line-2); border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--surface-2); color: var(--ink-2); font-size: 14.5px; font-weight: 600;
}
.auth-phone .auth-input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.auth-submit {
  width: 100%; justify-content: center; margin-top: 4px;
  padding: 13px 20px; font-size: 15px;
}
.auth-error {
  display: none; font-size: 13px; color: var(--red);
  background: rgba(226,87,76,.08); border-radius: 10px; padding: 9px 12px;
}
.auth-error.show { display: block; }

.auth-note {
  margin-top: 16px; font-size: 12px; line-height: 1.55; color: var(--ink-4); text-align: center;
}
.auth-note a { color: var(--teal-2); font-weight: 500; }
.auth-switch { margin-top: 14px; font-size: 13.5px; color: var(--ink-3); text-align: center; }
.auth-switch button { color: var(--teal-2); font-weight: 600; font-family: inherit; cursor: pointer; }

/* Korumalı işlemler için bilgi şeridi (modalın başında) */
.auth-gate {
  display: none; align-items: center; gap: 10px;
  background: var(--mint); color: var(--teal); border-radius: 12px;
  padding: 11px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 18px;
}
.auth-gate.show { display: flex; }
.auth-gate i { font-size: 18px; }

/* ============================================================
   Header — profil avatarı + açılır menü
   ============================================================ */
.avatar { cursor: pointer; user-select: none; transition: box-shadow .15s; }
.avatar:hover { box-shadow: 0 0 0 3px var(--mint-2); }

.profile-wrap { position: relative; }
.profile-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 350;
  width: 248px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px;
  display: none; opacity: 0; transform: translateY(-6px); transition: opacity .15s, transform .15s;
}
.profile-menu.open { display: block; opacity: 1; transform: none; }
.pm-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; }
.pm-head .av {
  width: 40px; height: 40px; border-radius: var(--r-pill); flex-shrink: 0;
  background: var(--mint-2); color: var(--teal); display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
}
.pm-head .nm { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.pm-head .em { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.pm-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.pm-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--ink); font-family: inherit; cursor: pointer; transition: background .12s; text-align: left;
}
.pm-item:hover { background: var(--surface-2); }
.pm-item i { font-size: 18px; color: var(--ink-3); width: 18px; }
.pm-item.danger { color: var(--red); }
.pm-item.danger i { color: var(--red); }

/* Çıkışta görünen "Giriş Yap" butonu (avatar yerine) */
.btn-auth {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background .15s;
}
.btn-auth:hover { background: var(--surface-3); }
.btn-auth i { font-size: 17px; }

/* ============================================================
   Gece modu uyumu
   ============================================================ */
[data-theme="dark"] .auth-card { background: var(--surface); }
[data-theme="dark"] .auth-google { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
[data-theme="dark"] .auth-google:hover { background: var(--surface-3); }
[data-theme="dark"] .auth-apple { background: #fff; color: #000; }
[data-theme="dark"] .auth-apple:hover { background: #e8e8e8; }
[data-theme="dark"] .auth-login-tabs { background: var(--surface-2); }
/* .auth-login-tabs aktif zemini kayan pill'de (style.css) */
[data-theme="dark"] .auth-input { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
[data-theme="dark"] .auth-phone .pre { background: var(--surface-3); }
[data-theme="dark"] .profile-menu { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .auth-seg { background: var(--surface-2); }
/* .auth-seg aktif zemini kayan pill'de (style.css) */

/* ============================================================
   Profil sayfası
   ============================================================ */
.profile-page { padding: 40px 0 80px; }
.profile-hero {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--shadow-sm);
}
.profile-hero .big-av {
  width: 76px; height: 76px; border-radius: var(--r-pill); flex-shrink: 0;
  background: var(--mint-2); color: var(--teal); display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 28px;
}
.profile-hero .who h1 { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.profile-hero .who .meta { font-size: 14px; color: var(--ink-3); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.profile-hero .who .meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-hero .who .badge-ok {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--teal);
  background: var(--mint); padding: 5px 11px; border-radius: var(--r-pill);
}
.profile-hero .signout { margin-left: auto; }

.profile-grid { display: grid; grid-template-columns: 220px 1fr; gap: 26px; margin-top: 28px; }
.profile-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; align-self: start; }
.profile-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: background .12s, color .12s;
}
.profile-nav a:hover { background: var(--surface-2); color: var(--ink); }
.profile-nav a.active { background: var(--mint); color: var(--teal); font-weight: 600; }
.profile-nav a i { font-size: 19px; }

.profile-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-sm);
  scroll-margin-top: 90px;
}
.profile-panel + .profile-panel { margin-top: 22px; }
.profile-panel h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.profile-panel .desc { font-size: 13.5px; color: var(--ink-3); margin-bottom: 22px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-grid .auth-field.full { grid-column: 1 / -1; }
.profile-panel .save-row { margin-top: 22px; display: flex; align-items: center; gap: 14px; }
.save-ok { font-size: 13.5px; color: var(--teal); font-weight: 600; opacity: 0; transition: opacity .2s; }
.save-ok.show { opacity: 1; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-3);
}
.empty-state i { font-size: 40px; color: var(--line-2); }
.empty-state p { margin-top: 12px; font-size: 14.5px; }
.empty-state .btn { margin-top: 18px; }

[data-theme="dark"] .profile-hero,
[data-theme="dark"] .profile-panel { background: var(--surface); border-color: var(--line); }

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .field-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 520px) {
  .auth-card { border-radius: var(--r-lg); }
  .auth-head { padding: 22px 20px 0; }
  .auth-body { padding: 18px 20px 24px; }
}
