/* ============================================================
   Çekiliş Sistemi - Kurumsal Modern UI (Teal palette)
   ============================================================ */
:root {
    --accent:        #00a099;   /* logo ana rengi */
    --accent-2:      #03665f;   /* logo koyu / hover */
    --accent-3:      #024c46;   /* en koyu vurgu */
    --accent-soft:   #cceceb;   /* açık zemin */
    --accent-softer: #e6f5f4;   /* en açık zemin */

    --text:        #0f172a;
    --text-muted:  #64748b;
    --line:        #e2e8f0;
    --line-soft:   #eef2f7;

    --card-bg: #ffffff;
    --error: #b91c1c;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;

    --shadow-lg: 0 30px 60px -20px rgba(3, 102, 95, .20), 0 8px 24px -8px rgba(15, 23, 42, .08);
    --shadow-md: 0 10px 25px -10px rgba(15, 23, 42, .12);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);

    --radius:    16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #f3faf8;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

/* arka plan dekoru — logo tonlu yumuşak gradient */
.bg-decor {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(900px 420px at 12% -10%, rgba(0, 160, 153, .16), transparent 60%),
        radial-gradient(720px 380px at 110% 8%, rgba(3, 102, 95, .12), transparent 60%),
        radial-gradient(600px 600px at 90% 110%, rgba(0, 160, 153, .08), transparent 60%),
        linear-gradient(180deg, #f0faf9 0%, #e6f5f4 100%);
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 20px;
}
@media (max-width: 600px) {
    .container { padding: 0; max-width: 100%; }
}

/* kart */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 44px 44px 40px;
    border: 1px solid rgba(0, 160, 153, .12);
}
.card-head { text-align: center; margin-bottom: 32px; }

@media (max-width: 600px) {
    .card {
        border-radius: 0;
        padding: 24px 16px 28px;
        min-height: 100vh;
        min-height: 100dvh;
        box-shadow: none;
        border: 0;
    }
    .card-head { margin-bottom: 22px; }
    .card h1 { font-size: 22px; }
    .brand-logo { width: 80px; margin-bottom: 14px; }
    .foot { display: none; }
}

/* logo - kutusuz, sade */
.brand-logo {
    width: 100%;
    height: auto;
    max-height: 96px;
    object-fit: contain;
    display: block;
    margin: 0 auto 20px;
}

.card h1 {
    margin: 0 0 10px;
    font-size: 28px;
    letter-spacing: -.015em;
    font-weight: 700;
    color: #0f172a;
}
.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
    max-width: 520px;
    margin-left: auto; margin-right: auto;
}

/* form */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    margin-top: 6px;
    align-items: start;
}
@media (max-width: 600px) {
    .grid { gap: 14px 10px; grid-template-columns: 1fr; }
    .captcha-reload { width: 38px; }
}

.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field--full { grid-column: 1 / -1; }
.field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    letter-spacing: .005em;
}
.field input[type=text],
.field input[type=tel],
.field input[type=password], .field input[type=email] {
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 15px;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}
.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 160, 153, .18);
}
.field .err  { color: var(--error); font-size: 12.5px; font-weight: 500; }
.field.has-error input { border-color: var(--error); background: var(--error-bg); }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* captcha — formun altında tam genişlik satır */
.captcha-cell { grid-column: 1 / -1; }
.captcha-cell .captcha-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: stretch;
}
.captcha-cell .captcha-cluster {
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 48px;
}
.captcha-cell .captcha-cluster img {
    height: 48px;
    width: auto;
    display: block;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    background: #03665f;
    object-fit: contain;
}
.captcha-reload {
    appearance: none; cursor: pointer;
    flex-shrink: 0;
    width: 44px; height: 48px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--accent-2);
    display: grid; place-items: center;
    transition: background .12s, border-color .12s, color .12s, transform .25s;
    padding: 0;
}
.captcha-reload:hover {
    background: var(--accent-softer);
    border-color: var(--accent);
    color: var(--accent-3);
}
.captcha-reload:active svg { transform: rotate(-180deg); }
.captcha-reload svg { width: 20px; height: 20px; transition: transform .4s; }
.captcha-cell input {
    letter-spacing: .15em; font-weight: 600; text-align: center;
}
@media (max-width: 600px) {
    .captcha-cell .captcha-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* checkbox */
.check-field { margin-top: 18px; }
.check {
    display: flex; gap: 10px; align-items: flex-start;
    cursor: pointer; font-size: 13.5px; color: #475569;
    line-height: 1.5;
}
.check input[type=checkbox] {
    width: 18px; height: 18px; margin-top: 1px;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.check a { color: var(--accent-2); text-decoration: none; font-weight: 500; }
.check a:hover { text-decoration: underline; }

/* alerts */
.alert {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error   { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }

/* butonlar */
.actions { margin-top: 28px; }
.btn-primary {
    appearance: none; border: 0; cursor: pointer;
    height: 52px; padding: 0 30px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff; font-weight: 600; font-size: 15.5px;
    box-shadow: 0 10px 24px -10px rgba(3, 102, 95, .55);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform .08s ease, box-shadow .15s, opacity .15s, filter .15s;
    font-family: inherit;
    letter-spacing: .01em;
}
/* form gönderim butonları tam genişlik, ortalı */
.actions .btn-primary { width: 100%; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(3, 102, 95, .6); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.btn-primary .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-primary.loading .spinner { display: inline-block; }
.btn-primary.loading .lbl { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    height: 44px; padding: 0 22px; border-radius: var(--radius-sm);
    background: #fff; color: var(--accent-2);
    border: 1.5px solid var(--accent);
    text-decoration: none; font-weight: 600; font-size: 14.5px;
    font-family: inherit; cursor: pointer;
    transition: background .12s, color .12s;
}
.btn-secondary:hover { background: var(--accent-softer); color: var(--accent-3); }

.btn-danger {
    appearance: none; border: 0; cursor: pointer;
    height: 44px; padding: 0 22px; border-radius: var(--radius-sm);
    background: #dc2626; color: #fff; font-weight: 600; font-size: 14.5px;
    font-family: inherit;
}
.btn-danger:hover { background: #b91c1c; }

.foot { text-align: center; margin-top: 22px; color: var(--text-muted); }

/* teşekkür */
.text-center { text-align: center; }
.check-circle {
    width: 84px; height: 84px; margin: 8px auto 18px;
    border-radius: 50%; background: var(--accent-soft);
    color: var(--accent-3);
    display: grid; place-items: center;
    border: 4px solid #99d6d2;
}
.check-circle svg { width: 50px; height: 50px; }

/* KVKK dialog */
.kvkk-dialog {
    border: 0; border-radius: var(--radius);
    padding: 30px; max-width: 560px; width: 92%;
    box-shadow: var(--shadow-lg);
}
.kvkk-dialog::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.kvkk-dialog h2 { margin-top: 0; color: var(--accent-3); }
.kvkk-dialog form { margin-top: 16px; text-align: right; }

/* ============================================================
   ADMIN
   ============================================================ */
.page-admin { background: #f3faf8; }
.admin-shell { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 14px 28px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.admin-topbar .brand {
    display: flex; align-items: center; gap: 10px; font-weight: 700;
    color: var(--accent-3);
}
.admin-topbar .brand img { width: 32px; height: 32px; object-fit: contain; }
.admin-topbar .spacer { flex: 1; }
.admin-topbar .who { color: var(--text-muted); font-size: 13.5px; }
.admin-topbar a.logout { color: var(--text-muted); text-decoration: none; font-size: 13.5px; }
.admin-topbar a.logout:hover { color: var(--text); }

.admin-main { padding: 28px; max-width: 1300px; margin: 0 auto; width: 100%; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
    background: #fff; border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow-md);
}
.stat .lbl { color: var(--text-muted); font-size: 13px; }
.stat .val { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; color: var(--accent-3); }
.stat .sub { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }

.toolbar {
    display: flex; gap: 10px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 14px;
    margin-bottom: 16px; box-shadow: var(--shadow-md);
    align-items: center;
}
.toolbar .search {
    flex: 1; min-width: 220px;
    height: 40px; padding: 0 12px; border-radius: 8px;
    border: 1.5px solid var(--line); background: #fff;
    font-size: 14px; font-family: inherit;
}
.toolbar .search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,160,153,.15); }

.tab-pills { display: flex; gap: 6px; }
.tab-pills a {
    padding: 8px 14px; border-radius: 999px; text-decoration: none;
    color: var(--text-muted); font-size: 13.5px; font-weight: 500;
    border: 1px solid transparent;
}
.tab-pills a.active { background: var(--accent-soft); color: var(--accent-3); border-color: #99d6d2; }

.table-wrap {
    background: #fff; border: 1px solid var(--line-soft);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-md);
}
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
    text-align: left; padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
}
table.data th { background: #f8fafc; font-weight: 600; color: #334155; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:hover { background: var(--accent-softer); }
table.data tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-win { background: var(--accent-soft); color: var(--accent-3); }
.badge-rank { background: #fef9c3; color: #854d0e; }
.empty { padding: 30px; text-align: center; color: var(--text-muted); }

.pager { display: flex; gap: 6px; padding: 12px; justify-content: center; }
.pager a, .pager span {
    padding: 6px 11px; border-radius: 8px;
    text-decoration: none; color: var(--text-muted); font-size: 13.5px;
    border: 1px solid var(--line);
}
.pager a:hover { color: var(--accent-2); border-color: var(--accent); }
.pager .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* login */
.login-shell {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(135deg, #024c46 0%, #03665f 55%, #00a099 100%);
    padding: 20px;
}
.login-card {
    background: #fff; border-radius: var(--radius);
    padding: 38px; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .subtitle { margin-bottom: 18px; }

/* draw modal */
.draw-result {
    background: #fff; border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 22px;
    margin-bottom: 18px; box-shadow: var(--shadow-md);
}
.draw-result h3 { margin: 0 0 8px; color: var(--accent-3); }
.draw-result p { margin: 0; color: var(--text-muted); font-size: 14px; }
@media(max-width:768px){
    .brand-logo{max-height:56px;}
    .field input[type=text], .field input[type=tel], .field input[type=password], .field input[type=email]{width:100%;}
    .captcha-cell .captcha-cluster{align-items:center;}
    .captcha-cell .captcha-cluster img{height:38px;}
    input::placeholder{font-size:12px;}
}