/* Yıldırım İş Takip — Design System */

:root {
    --turquoise: #62c3d0;
    --purple: #450e4b;
    --purple-light: #6b1a73;
    --purple-muted: rgba(69, 14, 75, 0.08);
    --turquoise-muted: rgba(98, 195, 208, 0.15);

    --bg: #fafafa;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: #ffffff;
    --border: rgba(69, 14, 75, 0.1);
    --border-focus: rgba(98, 195, 208, 0.6);

    --text-primary: #1a1a1a;
    --text-secondary: rgba(26, 26, 26, 0.55);
    --text-muted: rgba(26, 26, 26, 0.38);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-sm: 0 1px 2px rgba(69, 14, 75, 0.04);
    --shadow-md: 0 4px 24px rgba(69, 14, 75, 0.06), 0 1px 3px rgba(69, 14, 75, 0.04);
    --shadow-lg: 0 24px 64px rgba(69, 14, 75, 0.1), 0 8px 24px rgba(69, 14, 75, 0.06);
    --shadow-glow: 0 0 0 4px rgba(98, 195, 208, 0.2);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-framer: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg);
    min-height: 100dvh;
}

/* ─── Login Page ─── */

.login-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--bg);
}

.login-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: float 20s ease-in-out infinite;
}

.login-bg__orb--1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, var(--turquoise) 0%, transparent 70%);
    top: -12%;
    right: -8%;
    animation-delay: 0s;
}

.login-bg__orb--2 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
    bottom: -15%;
    left: -10%;
    animation-delay: -7s;
    opacity: 0.3;
}

.login-bg__orb--3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--turquoise-muted) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.6;
}

.login-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(69, 14, 75, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(69, 14, 75, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 75%);
    animation: gridFade 1.2s var(--ease-framer) both;
}

@keyframes gridFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* Card */

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px 40px;
}

.login-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    padding: 28px 40px;
}

.login-header__logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.login-card__header {
    text-align: left;
    margin-bottom: 36px;
}

.login-card__title {
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.login-card__subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Framer-style entrance animations */

[data-animate] {
    opacity: 0;
    will-change: opacity, transform, filter;
}

[data-animate="fade-up"] {
    transform: translateY(28px) scale(0.98);
    filter: blur(6px);
}

[data-animate="fade-down"] {
    transform: translateY(-16px);
    filter: blur(4px);
}

[data-animate].is-visible {
    animation: framerEnter 0.85s var(--ease-framer) both;
    animation-delay: calc(var(--delay, 0) * 0.08s);
}

[data-animate="fade-up"].is-visible {
    animation-name: framerEnterUp;
}

[data-animate="fade-down"].is-visible {
    animation-name: framerEnterDown;
}

@keyframes framerEnterUp {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.98);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes framerEnterDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Form */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-input-wrap {
    position: relative;
    transition: transform 0.25s var(--ease-framer);
}

.form-input-wrap:hover,
.form-input-wrap:focus-within {
    transform: translateY(-1px);
}

.form-input-wrap--icon .form-input {
    padding-left: 46px;
    padding-right: 16px;
}

.form-input-wrap--icon:has(.form-toggle-pw) .form-input {
    padding-right: 48px;
}

.form-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.25s var(--ease-framer), transform 0.25s var(--ease-spring);
}

.form-input-icon svg {
    width: 18px;
    height: 18px;
}

.form-input-wrap:focus-within .form-input-icon {
    color: var(--text-secondary);
}

.form-input {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--surface-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition:
        border-color 0.25s var(--ease-framer),
        box-shadow 0.25s var(--ease-framer),
        background 0.25s var(--ease-framer);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: rgba(69, 14, 75, 0.18);
}

.form-input:focus {
    border-color: rgba(69, 14, 75, 0.35);
    box-shadow: 0 0 0 4px rgba(69, 14, 75, 0.08);
    background: #fff;
}

/* Login steps */

.login-steps {
    position: relative;
    min-height: 140px;
}

.login-step {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.login-step.is-active {
    display: flex;
    animation: stepEnter 0.55s var(--ease-framer) both;
}

.login-step.is-exiting {
    display: flex;
    animation: stepExit 0.35s var(--ease-framer) both;
}

@keyframes stepEnter {
    from {
        opacity: 0;
        transform: translateX(24px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

@keyframes stepExit {
    from {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateX(-24px);
        filter: blur(4px);
    }
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-bottom: 4px;
    padding: 4px 8px 4px 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color 0.2s var(--ease-framer), background 0.2s var(--ease-framer);
}

.login-back svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.login-back:hover {
    color: var(--purple);
    background: var(--purple-muted);
}

.login-back span {
    letter-spacing: -0.01em;
}

.form-toggle-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color 0.2s var(--ease-framer), background 0.2s var(--ease-framer), transform 0.2s var(--ease-spring);
}

.form-toggle-pw:hover {
    color: var(--purple);
    background: var(--purple-muted);
}

.form-toggle-pw svg {
    width: 18px;
    height: 18px;
}

/* Alert */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}

.alert.is-visible {
    animation: framerEnterUp 0.6s var(--ease-framer) both;
}

.alert--error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.alert--error svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Button */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    border: none;
    cursor: pointer;
    transition:
        transform 0.15s var(--ease-spring),
        box-shadow 0.2s var(--ease-out),
        opacity 0.15s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-framer);
}

.btn__icon svg {
    width: 18px;
    height: 18px;
}

.btn--primary:hover .btn__icon {
    transform: translateX(2px);
}

.btn--primary {
    width: 100%;
    height: 52px;
    margin-top: 4px;
    border-radius: var(--radius-md);
    background: var(--purple);
    color: #fff;
    box-shadow: 0 4px 16px rgba(69, 14, 75, 0.3);
    transition:
        transform 0.3s var(--ease-spring),
        box-shadow 0.3s var(--ease-framer),
        background 0.25s var(--ease-framer);
}

.btn--primary:hover {
    background: var(--purple-light);
    box-shadow: 0 6px 24px rgba(69, 14, 75, 0.35);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 2px 8px rgba(69, 14, 75, 0.25);
}

.btn--primary .btn__loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn--primary.is-loading .btn__text,
.btn--primary.is-loading .btn__icon { display: none; }
.btn--primary.is-loading .btn__loader { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */

@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px 32px;
        border-radius: var(--radius-lg);
    }

    .login-card__title {
        font-size: 32px;
    }

    .login-header {
        padding: 20px 24px;
    }

    .login-header__logo {
        height: 34px;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .login-bg__orb,
    .login-bg__grid,
    [data-animate],
    [data-animate].is-visible,
    .alert.is-visible,
    .login-step.is-active,
    .login-step.is-exiting {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .btn--primary:hover,
    .form-input-wrap:hover,
    .form-input-wrap:focus-within {
        transform: none;
    }
}
