/* =========================================================
   BoilerPlateUzser — Login Page
   Split-screen + glassmorphism + ambient workflow graph
   ========================================================= */

:root {
    /* ----------------------------------------------------------------
       WHITE-LABEL — müşteri bazlı rebrand için TEK nokta.
       Fork'ta yalnızca bu blok + login.html'deki logo src'leri değişir;
       gerisi (layout, animasyon) bu değişkenlerden türer.
       ---------------------------------------------------------------- */
    --bg-deep: #0a0e27;
    --bg-mid: #1a1f3a;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-violet: #8b5cf6;
    --accent-success: #10b981;
    --accent-error: #ef4444;
    --accent-warn: #f59e0b;

    /* Ambient workflow graph (arka plan) — düşük alfa, dekoratif */
    --graph-node: rgba(125, 211, 252, 0.55);
    --graph-edge: rgba(99, 130, 246, 0.16);
    --graph-token: rgba(165, 243, 252, 0.95);
    --graph-opacity: 0.55;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-bg-strong: rgba(255, 255, 255, 0.09);
    --shadow-glow: 0 20px 60px -10px rgba(59, 130, 246, 0.35);
    --shadow-card: 0 24px 80px -20px rgba(0, 0, 0, 0.5);
    /* ---------------------------------------------------------------- */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    color: var(--text-primary);
    background: var(--bg-deep);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   Animated background — aurora wash + workflow graph + grid
   ========================================================= */
.bg-aurora {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f172a 100%);
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float 20s ease-in-out infinite;
    will-change: transform;
}

.aurora-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-blue), transparent 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.aurora-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-violet), transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.aurora-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.2;
}

@keyframes float {
    0%, 100%   { transform: translate(0, 0) scale(1); }
    33%        { transform: translate(40px, -40px) scale(1.05); }
    66%        { transform: translate(-30px, 30px) scale(0.95); }
}

.aurora-3 {
    animation-name: floatCenter;
}

@keyframes floatCenter {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.15); }
}

/* Ambient workflow node-graph — JS ile çizilir, saf dekoratif.
   JS yoksa / canvas desteklenmezse görünmez kalır, gradient base devreye girer. */
.bg-graph {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: var(--graph-opacity);
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* =========================================================
   Layout
   ========================================================= */
.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
    gap: 32px;
}

/* =========================================================
   Brand panel (left)
   ========================================================= */
.brand-panel {
    display: flex;
    align-items: center;
    padding: 40px;
    animation: fadeSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.brand-panel-inner {
    max-width: 540px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 56px;
}

.brand-mark {
    height: 84px;
    display: flex;
    align-items: center;
    padding: 12px 22px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-mark:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-logo-flow {
    filter: none;
}

.brand-x {
    font-size: 30px;
    font-weight: 200;
    color: var(--text-muted);
    letter-spacing: 4px;
}

.brand-headline {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.brand-headline-accent {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue), var(--accent-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

/* =========================================================
   Form panel (right)
   ========================================================= */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.form-card {
    width: 100%;
    max-width: 440px;
    padding: 48px 44px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    z-index: 2;
}

/* Restrained periodic sheen — yavaş, uzun dinlenmeli (kurumsal ton) */
.card-sheen {
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 44%,
        rgba(255, 255, 255, 0.10) 50%,
        rgba(255, 255, 255, 0.05) 56%,
        transparent 100%);
    transform: translateX(-130%) skewX(-12deg);
    animation: sheen 8s ease-in-out 2.5s infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sheen {
    0%        { transform: translateX(-130%) skewX(-12deg); }
    16%, 100% { transform: translateX(330%) skewX(-12deg); }
}

.form-header,
.form-body,
.form-footer {
    position: relative;
    z-index: 2;
}

.form-header {
    margin-bottom: 36px;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.form-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
}

/* .field{display:flex} UA [hidden]'ı ezer — geri al (tek login-method durumu) */
.field[hidden] {
    display: none;
}

/* =========================================================
   Inputs + floating label
   ========================================================= */
.input-wrap,
.select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.input-wrap input,
.select-wrap select {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}

/* Bayi formlarında input-icon yok — sol boşluğu ikon kadar bırakma */
.input-wrap:not(:has(.input-icon)) input {
    padding-left: 16px;
}

.input-wrap input:focus,
.select-wrap select:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-wrap:focus-within .input-icon,
.select-wrap:focus-within .input-icon {
    color: var(--accent-blue);
}

/* Floating label — boş & blur'da input içinde, focus/dolu'da yukarı çıkar */
.input-wrap label,
.select-wrap label {
    position: absolute;
    left: 46px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
    transition: top 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                font-size 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.18s ease,
                background 0.18s ease,
                padding 0.18s ease;
}

.input-wrap:not(:has(.input-icon)) label {
    left: 16px;
}

/* Chrome/Safari autofill :placeholder-shown tetiklemez; şifre alanı özellikle
   değer basıldığı halde etiketi ortada bırakır. :-webkit-autofill + .is-filled
   (float-labels.js) ile etiket her durumda yukarı çıkar. */
@keyframes bp-on-autofill {
    from { opacity: 0.999; }
    to   { opacity: 1; }
}

.input-wrap input:-webkit-autofill {
    animation-name: bp-on-autofill;
    animation-duration: 0.001s;
}

.input-wrap input:focus ~ label,
.input-wrap input:not(:placeholder-shown) ~ label,
.input-wrap input:-webkit-autofill ~ label,
.input-wrap input:autofill ~ label,
.input-wrap input.is-filled ~ label,
.field-select .select-wrap label {
    top: -9px;
    transform: translateY(0);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    background: var(--bg-mid);
    padding: 0 6px;
}

.input-wrap:not(:has(.input-icon)) input:focus ~ label,
.input-wrap:not(:has(.input-icon)) input:not(:placeholder-shown) ~ label,
.input-wrap:not(:has(.input-icon)) input:-webkit-autofill ~ label,
.input-wrap:not(:has(.input-icon)) input:autofill ~ label,
.input-wrap:not(:has(.input-icon)) input.is-filled ~ label {
    left: 10px;
}

.input-wrap input:focus ~ label,
.field-select .select-wrap select:focus ~ label {
    color: var(--accent-blue);
}

/* Chrome autofill sarı/beyaz boyayı koyu temaya uydur — etiketle çakışmayı keser */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
    box-shadow: 0 0 0 1000px #151a32 inset;
    border-color: var(--glass-border);
    transition: background-color 99999s ease-out;
}

/* Select (login method dropdown) */
.select-wrap select {
    padding-right: 40px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-wrap select option {
    background: var(--bg-mid);
    color: var(--text-primary);
}

.select-chevron {
    position: absolute;
    right: 16px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.2s, color 0.2s;
}

.select-wrap:focus-within .select-chevron {
    color: var(--accent-blue);
    transform: rotate(180deg);
}

.toggle-password {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    z-index: 1;
}

.toggle-password:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password.is-visible svg {
    color: var(--accent-blue);
}

/* Field hint (login-method ipucu) + Caps Lock uyarısı */
.field-hint,
.caps-hint {
    margin-top: 7px;
    padding-left: 4px;
    font-size: 0.75rem;
    line-height: 1.3;
}

.field-hint {
    color: var(--text-muted);
}

.caps-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-warn);
}

.caps-hint svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.caps-hint[hidden],
.field-hint[hidden] {
    display: none;
}

.form-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
    margin-bottom: 4px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-box {
    width: 18px;
    height: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-box::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 2px;
    transform: scale(0);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkbox input:checked ~ .checkbox-box {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox input:checked ~ .checkbox-box::after {
    transform: scale(1);
    background: transparent;
    width: 6px;
    height: 10px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    border-radius: 0;
    transform: rotate(45deg) scale(1) translate(-1px, -2px);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.link-muted {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.link-muted:hover {
    color: var(--accent-blue);
}

.form-error {
    display: none;
    padding: 10px 14px;
    margin-top: 4px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.8125rem;
    align-items: center;
    gap: 8px;
}

.form-error.is-visible {
    display: flex;
    animation: fadeSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-error::before {
    content: '⚠';
    font-size: 1rem;
}

/* =========================================================
   Submit button
   ========================================================= */
.btn-submit {
    position: relative;
    height: 50px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-violet) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.6);
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px -8px rgba(59, 130, 246, 0.8);
}

.btn-submit:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-label, .btn-arrow {
    position: relative;
    transition: transform 0.3s, opacity 0.2s;
}

.btn-arrow {
    width: 18px;
    height: 18px;
}

.btn-submit:hover:not(:disabled) .btn-arrow {
    transform: translateX(3px);
}

.btn-check {
    position: absolute;
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-check path {
    stroke-dasharray: 26;
    stroke-dashoffset: 26;
}

.btn-spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.7s linear infinite;
}

.btn-submit.is-loading .btn-label,
.btn-submit.is-loading .btn-arrow {
    opacity: 0;
    transform: translateY(8px);
}

.btn-submit.is-loading .btn-spinner {
    opacity: 1;
}

.btn-submit.is-success {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    pointer-events: none;
}

.btn-submit.is-success::before {
    opacity: 0;
}

.btn-submit.is-success .btn-label {
    opacity: 1;
    transform: translateY(0);
}

.btn-submit.is-success .btn-arrow {
    opacity: 0;
}

.btn-submit.is-success .btn-spinner {
    opacity: 0;
}

.btn-submit.is-success .btn-check {
    opacity: 1;
}

.btn-submit.is-success .btn-check path {
    animation: drawCheck 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.05s forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   Footer
   ========================================================= */
.form-footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.footer-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.powered-text, .footer-and {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.footer-logo {
    height: 24px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-credits .footer-logo:nth-of-type(1) {
    filter: brightness(0) invert(1);
}

.footer-version {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-6px); }
    80%      { transform: translateX(6px); }
}

.form-card.is-shaking {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 600px;
        height: auto;
        min-height: 100vh;
        padding: 24px;
    }

    .brand-panel {
        padding: 24px 8px;
        text-align: center;
    }

    .brand-lockup {
        justify-content: center;
        margin-bottom: 32px;
    }

    body, html {
        overflow-y: auto;
    }
}

@media (max-width: 540px) {
    .login-shell {
        padding: 16px;
        gap: 16px;
    }

    .form-card {
        padding: 32px 24px;
    }

    .brand-headline {
        font-size: 2rem;
    }

    .brand-mark {
        height: 64px;
        padding: 8px 16px;
    }

    .brand-logo {
        height: 40px;
    }
}

/* =========================================================
   Reduced motion — kurumsal / VDI / erişilebilirlik
   Tüm dekoratif hareketi durdur; statik son hâlleri garanti et.
   (Canvas grafiği ayrıca JS tarafında da kapatılır.)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bg-graph,
    .card-sheen {
        display: none;
    }

    /* Draw animasyonu kapalıyken checkmark yine de görünsün */
    .btn-submit.is-success .btn-check path {
        stroke-dashoffset: 0;
    }
}
