/* auth.css — Login/Qeydiyyat modalı + header avatar menyusu (passport. dizaynı) */

/* ===== HEADER: auth bölgəsi ===== */
.auth-zone { display: flex; align-items: center; gap: 12px; }
.auth-login-link {
  font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 14.5px; color: var(--ink);
  text-decoration: none; padding: 10px 8px; white-space: nowrap; transition: color var(--t-fast) var(--ease);
}
.auth-login-link:hover { color: var(--brand); }
.auth-signup-btn {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 14.5px; color: #fff;
  background: var(--brand-gradient); border: none; border-radius: var(--r-pill); padding: 11px 20px;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-pill); transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.auth-signup-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }

/* ===== Avatar — rəngli gradient halqa ===== */
.auth-user { position: relative; }
.auth-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  padding: 2.5px; border: none; cursor: pointer; flex: 0 0 auto; display: block;
  background: conic-gradient(from 210deg, #FF7AC2, #FFB86B, #FFD93D, #5B4FCF, #C026D3, #FF7AC2);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.auth-avatar:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91, 79, 207, .22); }
.auth-avatar .av-core {
  display: grid; place-items: center; width: 100%; height: 100%; box-sizing: border-box;
  border-radius: 50%; overflow: hidden; border: 2px solid var(--card-bg);
  background: var(--brand); color: #fff;
  font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 15px;
}
.auth-avatar .av-core img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Dropdown menyu ===== */
.auth-menu {
  position: absolute; top: calc(100% + 14px); right: 0; width: 288px; z-index: 1200;
  background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 20px;
  box-shadow: 0 20px 48px rgba(26, 26, 77, .16), 0 2px 6px rgba(26, 26, 77, .06);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97);
  transform-origin: top right;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease-out), visibility var(--t-fast);
}
.auth-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* İstifadəçi kartı (yuxarıda) */
.auth-menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; margin-bottom: 4px; border-radius: 14px;
  text-decoration: none; transition: background var(--t-fast) var(--ease);
}
.auth-menu-head:hover { background: var(--inner); }
.auth-menu-head .auth-avatar { width: 42px; height: 42px; }
.auth-menu-head .auth-avatar .av-core { font-size: 14px; }
.auth-menu-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.auth-menu-name { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-menu-email { font-family: 'Inter', sans-serif; font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Qruplar + ayırıcı */
.auth-menu-group { display: flex; flex-direction: column; gap: 2px; }
.auth-menu-sep { height: 1px; background: var(--border-soft); margin: 8px 6px; border: 0; }

/* Elementlər */
.auth-menu-item {
  display: flex; align-items: center; gap: 14px; width: 100%; box-sizing: border-box;
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 500; color: var(--ink);
  background: none; border: none; border-radius: 12px; padding: 11px 12px; cursor: pointer;
  text-decoration: none; text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.auth-menu-item span { flex: 1 1 auto; }
.auth-menu-item:hover,
.auth-menu-item.is-active { background: var(--inner); }
.auth-menu-item.is-active { font-weight: 600; }
.auth-menu-item svg { width: 21px; height: 21px; flex: 0 0 21px; stroke: currentColor; color: var(--ink); }
.auth-menu-item.is-logout:hover { color: #DC2626; background: #FEF2F2; }
.auth-menu-item.is-logout:hover svg { color: #DC2626; }

/* PRO badge (Təqaüdlər) — screendəki yaşıl pill */
.auth-menu-badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px;
  font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 10.5px; letter-spacing: .04em;
  color: #15803D; background: var(--green-soft, #DCFCE7); border: 1px solid #BBF7D0;
  padding: 3px 8px 3px 6px; border-radius: 999px;
}
.auth-menu-badge svg { width: 11px !important; height: 11px !important; flex: 0 0 11px !important; color: #16A34A; }

/* ===== MODAL ===== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(26,26,77,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; overflow-y: auto;
  padding: 20px; opacity: 0; visibility: hidden; transition: opacity var(--t-med) var(--ease), visibility var(--t-med);
}
.auth-modal { margin: auto 0; }
.auth-overlay.is-open { opacity: 1; visibility: visible; }
.auth-modal {
  width: 100%; max-width: 440px; background: var(--card-bg); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 40px 38px; position: relative; transform: translateY(16px) scale(.98);
  transition: transform var(--t-med) var(--ease-out);  /* daxili sürüşmə yoxdur */
}
.auth-overlay.is-open .auth-modal { transform: translateY(0) scale(1); }
.auth-close {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--inner); color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease);
}
.auth-close:hover { background: var(--inner-2); }
.auth-close svg { width: 16px; height: 16px; stroke: currentColor; }

.auth-title { font-family: 'Bricolage Grotesque','Montserrat',sans-serif; font-weight: 700; font-size: 28px; color: var(--ink); text-align: center; margin: 4px 0 28px; }

/* Alt-xətli (underline) inputlar — U-Pass formatı */
.auth-field { position: relative; margin-bottom: 6px; }
.auth-field input {
  width: 100%; box-sizing: border-box; font-family: 'Inter', sans-serif; font-size: 16px; color: var(--ink);
  background: rgba(91, 79, 207, 0.045); border: 1.5px solid transparent; border-radius: 14px; padding: 15px 16px;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.auth-field input:focus { outline: none; border-color: var(--brand); background: #fff; }
.auth-field input::placeholder { color: var(--mute); }
.auth-field-pass input { padding-right: 46px; }
.auth-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: none; background: none;
  color: var(--mute); cursor: pointer; display: grid; place-items: center;
}
.auth-eye svg { width: 19px; height: 19px; }
.auth-eye.is-on { color: var(--brand); }

/* Məni xatırla + Şifrəni unutmusan sırası */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 22px; flex-wrap: wrap; }
.auth-remember { display: inline-flex; align-items: center; gap: 8px; font-family: 'Inter', sans-serif; font-size: 14px; color: var(--ink-2); cursor: pointer; }

/* Yumru (rounded) checkbox — Məni xatırla + razılıq üçün */
.auth-remember input,
.auth-consent input {
  -webkit-appearance: none; appearance: none;
  width: 19px; height: 19px; flex-shrink: 0;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: #fff; cursor: pointer; position: relative;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.auth-remember input:checked,
.auth-consent input:checked {
  background: var(--brand-gradient); border-color: transparent;
}
.auth-remember input:checked::after,
.auth-consent input:checked::after {
  content: ''; position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.auth-forgot { background: none; border: none; color: var(--brand); font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; cursor: pointer; }
.auth-forgot:hover { text-decoration: underline; }

/* Gizlilik/Şərtlər razılığı (yalnız qeydiyyat) */
.auth-consent { display: flex; align-items: flex-start; gap: 9px; margin: -6px 0 18px; font-family: 'Inter', sans-serif; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
/* [hidden] atributu display:flex tərəfindən üstələnirdi — yalnız qeydiyyatda göstər */
.auth-consent[hidden] { display: none; }
.auth-consent input { margin-top: 1px; }
.auth-consent a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-consent a:hover { text-decoration: underline; }

/* Qradiyent əsas düymə */
.auth-submit {
  width: 100%; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 16px; color: #fff;
  background: var(--brand-gradient);
  border: none; border-radius: var(--r-pill); padding: 16px; cursor: pointer; margin-top: 4px;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .28); transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.auth-submit:hover { transform: translateY(-2px); filter: brightness(1.05); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.auth-divider { text-align: center; color: var(--mute); font-family: 'Inter', sans-serif; font-size: 14px; margin: 18px 0; }

/* Konturlu Google düyməsi */
.auth-google {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; box-sizing: border-box;
  font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 15px; color: var(--brand);
  background: var(--card-bg); border: 1.5px solid var(--brand); border-radius: var(--r-pill); padding: 14px;
  cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.auth-google:hover { background: var(--brand-soft); }
.auth-google img { width: 19px; height: 19px; }

.auth-error { font-family: 'Inter', sans-serif; font-size: 13.5px; color: #DC2626; background: #FEF2F2; border: 1px solid #FECACA; border-radius: var(--r-sm); padding: 11px 14px; margin-bottom: 16px; display: none; }
.auth-error.is-on { display: block; }
.auth-note { font-family: 'Inter', sans-serif; font-size: 13.5px; color: #15803D; background: var(--green-soft); border-radius: var(--r-sm); padding: 11px 14px; margin-bottom: 16px; display: none; }
.auth-note.is-on { display: block; }

.auth-switch { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--ink-2); font-weight: 600; text-align: center; margin: 20px 0 0; }
.auth-switch button { background: none; border: none; color: var(--brand); font-weight: 700; cursor: pointer; font-size: 14px; }
.auth-switch button:hover { text-decoration: underline; }

/* yalnız giriş edənə / etməyənə görə görünmə */
[data-auth="in"], [data-auth="out"] { display: none; }
body.is-authed [data-auth="in"] { display: revert; }
body:not(.is-authed) [data-auth="out"] { display: revert; }

@media (max-width: 600px) {
  .auth-modal { padding: 34px 24px; }
  .auth-menu { width: min(300px, calc(100vw - 28px)); right: 0; }
  .auth-avatar { width: 42px; height: 42px; }
}
