/* ==========================================================================
   Auth ekranları (giriş, şifremi unuttum, şifre sıfırlama)
   Client ve Yönetim panelleri aynı dosyayı paylaşır.
   Panel rengini değiştirmek için <body> üzerine tema sınıfı ekleyin.
   ========================================================================== */

:root {
    --auth-darkest: #0c2d48;
    --auth-dark: #0369a1;
    --auth-primary: #0284c7;
    --auth-light: #0ea5e9;
    --auth-accent: #7dd3fc;
    --auth-shadow: rgba(2, 132, 199, .35);
    --auth-shadow-hover: rgba(2, 132, 199, .45);
    --auth-ring: rgba(2, 132, 199, .12);
    --auth-info-bg: #f0f9ff;
    --auth-info-border: #bae6fd;
}

/* Yönetim paneli teması */
.auth-theme-yonetim {
    --auth-darkest: #1e1b4b;
    --auth-dark: #4338ca;
    --auth-primary: #4f46e5;
    --auth-light: #6366f1;
    --auth-accent: #c7d2fe;
    --auth-shadow: rgba(79, 70, 229, .35);
    --auth-shadow-hover: rgba(79, 70, 229, .45);
    --auth-ring: rgba(79, 70, 229, .12);
    --auth-info-bg: #eef2ff;
    --auth-info-border: #c7d2fe;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    background: #f0f4f8;
    overflow-x: hidden;
}

/* ── Animasyonlar ── */
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes floatA {
    0%,100% { transform: translateY(0) rotate(0deg) scale(1); }
    33%      { transform: translateY(-30px) rotate(120deg) scale(1.05); }
    66%      { transform: translateY(20px) rotate(240deg) scale(0.95); }
}
@keyframes floatB {
    0%,100% { transform: translateX(0) rotate(0deg); }
    50%      { transform: translateX(25px) rotate(180deg); }
}
@keyframes floatC {
    0%,100% { transform: translate(0,0) scale(1); }
    40%      { transform: translate(-20px, 15px) scale(1.1); }
    80%      { transform: translate(15px, -10px) scale(0.9); }
}
@keyframes logoPulse {
    0%,100% { filter: drop-shadow(0 0 0px rgba(255,255,255,0)); }
    50%      { filter: drop-shadow(0 0 12px rgba(255,255,255,0.5)); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Aynalanmış yerleşim: form solda, marka paneli sağda (kayıt sayfası) */
.auth-reversed { flex-direction: row-reverse; }
.auth-reversed .auth-right { animation-name: slideInLeft; }

/* ── Marka Paneli ── */
.auth-left {
    width: 45%;
    min-height: 100vh;
    background: linear-gradient(135deg,
        var(--auth-darkest), var(--auth-dark), var(--auth-primary),
        var(--auth-light), var(--auth-dark), var(--auth-darkest));
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2.5rem;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Floating shapes */
.auth-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}
.auth-shape-1 { width:280px;height:280px; top:-80px;  right:-80px; animation: floatA 9s ease-in-out infinite; }
.auth-shape-2 { width:180px;height:180px; bottom:8%;  left:-50px;  animation: floatB 7s ease-in-out infinite; animation-delay:-3s; }
.auth-shape-3 { width:120px;height:120px; bottom:25%; right:10%;   animation: floatC 11s ease-in-out infinite; animation-delay:-5s; }
.auth-shape-4 { width:70px; height:70px;  top:28%;    left:15%;    animation: floatA 8s ease-in-out infinite; animation-delay:-1s; }
.auth-shape-5 { width:40px; height:40px;  top:55%;    right:18%;   animation: floatB 6s ease-in-out infinite; animation-delay:-2s; background: rgba(255,255,255,0.12); }

.auth-left-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    animation: fadeInUp .8s ease both;
}

.auth-logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2rem;
    animation: logoPulse 3s ease-in-out infinite;
}
.auth-logo-wrap img {
    height: 52px;
    filter: brightness(0) invert(1);
}
.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #fff;
}

/* Genel Ayarlar'dan yüklenen logo/loader logo kendi renkleriyle gösterilir,
   statik SVG'ye uygulanan beyazlatma filtresi bunlara uygulanmaz. */
.auth-logo-wrap img.auth-logo-dinamik {
    height: 44px;
    max-width: 160px;
    object-fit: contain;
    filter: none;
    border-radius: 8px;
    background: #fff;
    padding: .25rem .4rem;
}
.auth-logo-wrap img.auth-logo-text-img {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.auth-left-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: .9;
}

.auth-left-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: .75rem;
    line-height: 1.2;
}
.auth-left-sub {
    font-size: 1rem;
    opacity: .8;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* İkonlu varyant (şifremi unuttum, şifre sıfırlama vb.) biraz daha küçük başlık kullanır */
.auth-left-icon + .auth-left-title { font-size: 1.8rem; }
.auth-left-icon ~ .auth-left-sub { font-size: .95rem; margin-bottom: 0; }

.auth-features {
    list-style: none;
    padding: 0;
    text-align: left;
    display: inline-block;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .85rem;
    font-size: .9rem;
    opacity: .85;
    animation: fadeInUp .6s ease both;
}
.auth-features li:nth-child(1) { animation-delay: .3s; }
.auth-features li:nth-child(2) { animation-delay: .5s; }
.auth-features li:nth-child(3) { animation-delay: .7s; }
.auth-features li:nth-child(4) { animation-delay: .9s; }
.auth-features li i {
    font-size: 1.1rem;
    color: var(--auth-accent);
    flex-shrink: 0;
}

/* ── Sağ Panel ── */
.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: slideInRight .7s ease both;
    animation-delay: .15s;
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
}

.auth-form-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 2rem;
}
.auth-form-logo img { height: 36px; }
.auth-form-logo span { font-size: 1.1rem; font-weight: 700; color: var(--auth-dark); }

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .3rem;
}
.auth-form-sub {
    font-size: .88rem;
    color: #64748b;
    margin-bottom: 2rem;
}
/* Altında bilgi kutusu varken aradaki boşluk daralır */
.auth-form-sub.is-tight { margin-bottom: 1.25rem; }

/* Bilgilendirme kutusu */
.auth-info-box {
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-info-border);
    border-radius: 10px;
    padding: .9rem 1rem;
    margin-bottom: 1.5rem;
    font-size: .84rem;
    color: var(--auth-dark);
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    line-height: 1.5;
}
.auth-info-box i {
    flex-shrink: 0;
    margin-top: .05rem;
    font-size: 1rem;
}

/* Alert */
.auth-alert {
    padding: .8rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.25rem;
}
.auth-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.auth-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.auth-alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Form inputs */
.auth-input-group {
    position: relative;
    margin-bottom: 1.1rem;
}
.auth-input-group label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .35rem;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.auth-input-wrap {
    position: relative;
}
.auth-input-icon {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color .2s;
}
.auth-input {
    width: 100%;
    padding: .75rem 1rem .75rem 2.6rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .9rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none;
}
.auth-input:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--auth-ring);
}
.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-primary);
}
.auth-input.is-invalid { border-color: #ef4444; }
.auth-input-toggle {
    position: absolute;
    right: .9rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    background: none;
    border: none;
    padding: 0;
    transition: color .2s;
}
.auth-input-toggle:hover { color: var(--auth-primary); }
.auth-field-error {
    font-size: .78rem;
    color: #ef4444;
    margin-top: .3rem;
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* Şifre gücü göstergesi */
.auth-strength {
    height: 4px;
    border-radius: 4px;
    background: #e2e8f0;
    margin-top: .5rem;
    overflow: hidden;
}
.auth-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width .3s ease, background .3s ease;
}
.auth-strength-label {
    font-size: .73rem;
    margin-top: .3rem;
    color: #64748b;
    min-height: 1.1em;
}

/* Options row */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.auth-remember {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    font-size: .84rem;
    color: #374151;
    user-select: none;
}
.auth-remember input[type=checkbox] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-primary);
    cursor: pointer;
}
.auth-forgot {
    font-size: .84rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color .2s;
}
.auth-forgot:hover { color: var(--auth-dark); text-decoration: underline; }

/* Submit button */
.auth-btn {
    width: 100%;
    padding: .85rem;
    background: linear-gradient(135deg, var(--auth-dark), var(--auth-primary));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: transform .18s, box-shadow .18s, opacity .18s;
    box-shadow: 0 4px 14px var(--auth-shadow);
    margin-bottom: 1rem;
}
.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--auth-shadow-hover);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}
.auth-btn .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}
.auth-btn.loading .spinner { display: block; }
.auth-btn.loading .btn-text { display: none; }

/* Geri dön bağlantısı */
.auth-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-size: .85rem;
    color: #64748b;
    text-decoration: none;
    transition: color .2s;
    margin-top: .5rem;
}
.auth-back:hover { color: var(--auth-primary); }

.auth-footer {
    text-align: center;
    font-size: .8rem;
    color: #94a3b8;
    margin-top: 1.5rem;
}

/* Alt bağlantı (kayıt ol / giriş yap geçişleri) */
.auth-switch {
    text-align: center;
    font-size: .86rem;
    color: #64748b;
}
.auth-switch a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .auth-left { display: none; }
    body { background: #fff; }
    .auth-right { padding: 1.5rem; align-items: flex-start; padding-top: 3rem; }
    .auth-form-card { max-width: 100%; }
}

/* ── Hareket azaltma tercihi ── */
@media (prefers-reduced-motion: reduce) {
    .auth-left, .auth-left-inner, .auth-right, .auth-shape,
    .auth-logo-wrap, .auth-features li {
        animation: none !important;
    }
}

/* Firma bilgilerini tamamlama: daha geniş kart, iki sütunlu alanlar, textarea */
.auth-genis .auth-form-card { max-width: 640px; }
.auth-genis .auth-alan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
}
.auth-genis .auth-alan-grid .auth-alan-tam { grid-column: 1 / -1; }
.auth-genis textarea.auth-input { resize: vertical; min-height: 84px; }
.auth-genis .auth-input-wrap--textarea .auth-input-icon { top: 1.35rem; }
@media (max-width: 576px) {
    .auth-genis .auth-alan-grid { grid-template-columns: 1fr; }
}

/* Kayıt Ol: yasal metin onayları */
.auth-onaylar { display: flex; flex-direction: column; gap: .55rem; margin: -.25rem 0 1.25rem; }
.auth-onay { align-items: flex-start; font-size: .8rem; line-height: 1.45; }
.auth-onay input[type=checkbox] { flex-shrink: 0; margin-top: .1rem; }
.auth-onay a { font-weight: 700; color: var(--auth-primary); }
.auth-yasal { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .9rem; margin-top: .35rem; }
.auth-yasal a { color: inherit; text-decoration: none; }
.auth-yasal a:hover { color: var(--auth-primary); text-decoration: underline; }
