/* Login Page — Modern Design System */

:root {
    --login-bg:      #0b0f19;
    --login-panel:   #111827;
    --login-border:  #1f2937;
    --login-text:    #f3f4f6;
    --login-muted:   #9ca3af;
    --login-accent:  #10b981;   /* Emerald-500 */
    --login-accent2: #059669;   /* Emerald-600 */
    --login-red:     #ef4444;
    --login-amber:   #f59e0b;
    --login-shadow:  0 20px 60px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    background: var(--login-bg);
    color: var(--login-text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* Subtle radial glow in background */
    background-image:
        radial-gradient(circle at 20% 50%, rgba(99,102,241,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139,92,246,0.05) 0%, transparent 40%);
}

/* ─── Shell ─────────────────────────────────────────────────────── */
.login-shell {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--login-panel);
    border: 1px solid var(--login-border);
    border-radius: 24px;
    padding: 40px 36px 36px;
    box-shadow: var(--login-shadow);
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s;
}

/* Decorative top gradient bar — köşe yarıçapı karttan miras alınır */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--login-accent), var(--login-accent2));
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    pointer-events: none;
}

.login-card.has-error {
    border-color: rgba(239,68,68,0.35);
}

/* ─── Header / Brand ─────────────────────────────────────────────── */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2.5px;
    margin-bottom: 16px;
    /* Brand mark with gradient */
    background: linear-gradient(135deg, var(--login-accent), var(--login-accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand span {
    -webkit-text-fill-color: var(--login-text);
    background: none;
    color: var(--login-text);
}

#login-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--login-text);
    letter-spacing: -0.3px;
}

.login-lead {
    font-size: 13px;
    color: var(--login-muted);
    margin: 0;
    line-height: 1.5;
}

/* ─── Alert Banners ──────────────────────────────────────────────── */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 22px;
    border: 1px solid;
    line-height: 1.45;
    animation: alertSlideIn 0.25s ease both;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-alert--warning {
    background: rgba(245,158,11,0.1);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.22);
}

.login-alert--error {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.22);
}

/* ─── Form ───────────────────────────────────────────────────────── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--login-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.form-control {
    background: rgba(15,23,42,0.65);
    border: 1px solid var(--login-border);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--login-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    width: 100%;
}

.form-control::placeholder {
    color: rgba(148,163,184,0.55);
}

.form-control:hover {
    border-color: #475569;
    background: rgba(15,23,42,0.8);
}

.form-control:focus {
    border-color: var(--login-accent);
    background: rgba(15,23,42,0.85);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18), 0 0 8px rgba(16, 185, 129, 0.12);
}

/* Autofill override — panel rengiyle uyumlu */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--login-text) !important;
    caret-color: var(--login-text) !important;
    box-shadow: 0 0 0px 1000px var(--login-panel) inset !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--login-panel) inset !important;
    border-color: var(--login-border) !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* ─── Şifre Göster/Gizle ─────────────────────────────────────────── */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--login-muted);
    border-radius: 8px;
    line-height: 0;
    transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.password-toggle:hover {
    color: var(--login-text);
    background: rgba(148,163,184,0.10);
}

.password-toggle:focus-visible {
    color: var(--login-text);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.55);
}

.password-toggle .pt-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.password-toggle .pt-icon[hidden] {
    display: none;
}

/* ─── Honeypot (gizli alan — bot tuzağı) ─────────────────────────── */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ─── Submit Button ──────────────────────────────────────────────── */
.btn-submit {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #022c22;
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 14px;
    padding: 15px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
    letter-spacing: 0.2px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.28);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.38);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-submit:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.7);
    outline-offset: 2px;
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Shimmer loading state */
.btn-submit.is-loading {
    pointer-events: none;
    opacity: 0.82;
}

.btn-submit.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: loginShimmer 1.1s linear infinite;
}

@keyframes loginShimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-shell {
        padding: 14px;
    }

    .login-card {
        padding: 28px 22px 26px;
        border-radius: 18px;
    }

    #login-title {
        font-size: 18px;
    }

    /* iOS Safari: 16px altı input odaklanınca otomatik zoom yapıyor. Engelle. */
    .form-control {
        font-size: 16px;
        padding: 14px 16px;
    }

    .btn-submit {
        font-size: 16px;
        padding: 16px;
    }
}

/* ─── Erişilebilirlik: hareket azaltma tercihi ───────────────────── */
@media (prefers-reduced-motion: reduce) {
    .login-alert,
    .btn-submit,
    .btn-submit:hover,
    .btn-submit:active,
    .form-control {
        animation: none !important;
        transition: none !important;
    }

    .btn-submit.is-loading::after {
        animation: none !important;
    }
}
