/* ==========================================================
   Hesap modalı
   ========================================================== */
html.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(11, 27, 51, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; }
.modal__dialog {
  position: relative; display: grid; grid-template-columns: 340px 1fr;
  width: 100%; max-width: 900px; max-height: calc(100vh - 48px);
  background: var(--surface); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(11, 27, 51, .45);
  opacity: 0; transform: translateY(12px) scale(.985); transition: opacity .18s, transform .18s;
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__dialog { opacity: 1; transform: none; }
.modal__close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; }
.modal__close:hover { background: var(--surface-2); }
.modal__close svg { width: 18px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; }

.modal__aside {
  background: var(--brand); color: #C9D4E6; padding: 32px; display: flex; flex-direction: column; gap: 32px;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.brand--light .brand__text { color: #fff; }
.brand--light .brand__mark rect:first-child { fill: #fff; }
.brand--light .brand__mark rect:not(:first-child):not(:last-child) { fill: var(--brand); }
.modal__aside-body { margin-top: auto; }
.modal__aside h3 { color: #fff; font-size: 1.35rem; line-height: 1.3; margin-bottom: 20px; letter-spacing: -.02em; }
.modal__aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.modal__aside li { position: relative; padding-left: 26px; font-size: .92rem; color: #E1E8F3; }
.modal__aside li::before { content: ""; position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: rgba(79,209,161,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%234FD1A1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.modal__aside-foot { font-size: .78rem; color: #93A3BD; display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.modal__aside-foot svg { width: 16px; flex: none; fill: none; stroke: #93A3BD; stroke-width: 1.6; margin-top: 1px; }

.modal__main { padding: 28px 36px; overflow-y: auto; }
.auth-tabs { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 9px; margin-bottom: 22px; }
.auth-tabs[hidden] { display: none; }
.auth-tabs button { border: 0; background: transparent; padding: 7px 16px; border-radius: 7px; font-size: .88rem; font-weight: 500; color: var(--muted); }
.auth-tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-head { margin-bottom: 20px; }
.auth-head h2 { font-size: 1.45rem; margin-bottom: 4px; }
.auth-head p { color: var(--muted); font-size: .93rem; }
.auth-form[hidden], .auth-success[hidden] { display: none; }

/* Form alanları (site ve yönetim paneli ortak) */
.form-alert { background: var(--down-bg); color: #A51F2D; border: 1px solid #F5C9CE; border-radius: 8px; padding: 10px 14px; font-size: .88rem; margin-bottom: 16px; }
.form-alert[hidden] { display: none; }
.form-alert--ok { background: var(--up-bg); color: #08704A; border-color: #BFE5D3; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: .84rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.field input:not([type="checkbox"]), .field select {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #A3AEBF; }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(26,74,150,.12); }
.field.has-error input, .field.has-error select { border-color: var(--down); }
.field.has-error input:focus { box-shadow: 0 0 0 3px rgba(204,43,59,.12); }
.field__err { display: none; color: var(--down); font-size: .8rem; margin-top: 5px; }
.field.has-error .field__err { display: block; }
.field__hint { display: block; color: var(--muted); font-size: .78rem; margin-top: 6px; }
.field.has-error .field__hint { display: none; }

.phone { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
.field .phone select { padding: 0 10px; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%236A7890' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 8px center/16px no-repeat; font-family: var(--mono); font-size: .88rem; }
.field .phone input { font-family: var(--mono); letter-spacing: .02em; }

.pass { position: relative; }
.field .pass input { padding-right: 76px; }
.pass__toggle { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; background: transparent; border-radius: 6px; font-size: .8rem; font-weight: 500; color: var(--brand-2); }
.pass__toggle:hover { background: var(--surface-2); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.strength span { height: 3px; border-radius: 2px; background: var(--line); transition: background .2s; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--down); }
.strength[data-level="2"] span:nth-child(-n+2) { background: #E39A1C; }
.strength[data-level="3"] span:nth-child(-n+3) { background: #4C9F38; }
.strength[data-level="4"] span { background: var(--up); }

.field--check { margin-bottom: 10px; }
.field .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .85rem; color: var(--ink-2); cursor: pointer; line-height: 1.5; margin: 0; }
.check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.check a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; }
.check em { color: var(--muted); font-style: normal; }
.field--check.has-error .check { color: var(--down); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn--block { width: 100%; margin-top: 10px; }
.btn .spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .btn__label { opacity: .7; }
.btn.is-loading .spinner { display: inline-block; }
.btn:disabled { cursor: default; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-switch { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 16px; }
.auth-switch button { border: 0; background: none; padding: 0; color: var(--brand-2); font-weight: 600; }
.auth-switch button:hover { text-decoration: underline; }

.auth-success { text-align: center; padding: 56px 12px; }
.auth-success__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--up-bg); display: grid; place-items: center; margin: 0 auto 22px; }
.auth-success__icon svg { width: 30px; fill: none; stroke: var(--up); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.auth-success h2 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-success p { color: var(--muted); max-width: 360px; margin: 0 auto 28px; }

/* Kullanıcı menüsü */
.usermenu { position: relative; }
.usermenu__btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.usermenu__btn:hover { border-color: var(--line-2); }
.usermenu__btn svg { width: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 600; letter-spacing: .02em; flex: none; }
.usermenu__name { font-size: .9rem; font-weight: 500; color: var(--ink); }
.usermenu__drop { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.usermenu__drop[hidden] { display: none; }
.usermenu__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu__head b { display: block; color: var(--ink); font-size: .92rem; }
.usermenu__head span { font-size: .8rem; color: var(--muted); word-break: break-all; }
.usermenu__drop a, .usermenu__drop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px; border: 0; background: none; font-size: .9rem; color: var(--ink-2); }
.usermenu__drop a:hover, .usermenu__drop button:hover { background: var(--surface-2); color: var(--ink); }
.usermenu__drop button { color: var(--down); }

@media (max-width: 860px) {
  .modal { padding: 0; place-items: end center; }
  .modal__dialog { grid-template-columns: 1fr; max-height: 94vh; border-radius: 16px 16px 0 0; transform: translateY(40px); }
  .modal__aside { display: none; }
  .modal__main { padding: 24px 20px 28px; }
}
@media (max-width: 420px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
