/* =====================================================
   Login.razor scoped styles — Phase 3-A redesign
   - Split layout (form left, hero right) on desktop ≥1024px
   - Mobile-first: stacked, hero hidden under 1024px
   - Tokens only — no raw hex values
   ===================================================== */

.login-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

/* ---------- Form column ---------- */
.login-shell__form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: var(--gs-space-6) var(--gs-space-4);
    background: var(--gs-bg);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* ---------- Brand block ---------- */
.login-shell__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gs-space-3);
    text-align: center;
    margin-bottom: var(--gs-space-8);
}

.login-shell__logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    /* ~squircle: yumuşak sarı kutu (referans ss) */
    border-radius: 28%;
    box-sizing: border-box;
}

/* Sarı kutu — logo şeffaf; sarı zemin tek renk, hafif iç boşluk = damga hissi */
.login-shell__logo--tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gs-primary);
    padding: 10px;
    overflow: hidden;
}

.login-shell__logo-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

/* Görsel yüklenemezse (eski yedek) */
.login-shell__logo--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gs-primary);
    color: var(--gs-text-inverse);
    font-family: var(--gs-font-heading, "Space Grotesk", sans-serif);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
}

.login-shell__title {
    font-family: var(--gs-font-heading, "Space Grotesk", sans-serif);
    font-size: var(--gs-text-2xl);
    font-weight: 700;
    color: var(--gs-primary);
    margin: 0;
    /* Mobile: tighter letter-spacing for readability (audit L3) */
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-shell__subtitle {
    color: var(--gs-text-muted);
    margin: 0;
    font-size: var(--gs-text-base);
}

/* ---------- Form layout (field + child styles — <form> card lives in app.css for EditForm) ---------- */
.login-shell__field {
    display: flex;
    flex-direction: column;
    gap: var(--gs-space-3);
}

.login-shell__field--password {
    gap: var(--gs-space-3);
}

.login-shell__label {
    font-size: var(--gs-text-sm);
    font-weight: 600;
    color: var(--gs-text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.3;
    margin: 0;
}

.login-shell__input {
    width: 100%;
    min-height: 48px;
    padding: var(--gs-space-4) var(--gs-space-4);
    border-radius: var(--gs-radius-md);
    line-height: 1.45;
}

.login-shell__field:focus-within .login-shell__label {
    color: var(--gs-text);
}

/* Password field with toggle button overlay */
.login-shell__password {
    position: relative;
    display: flex;
    align-items: center;
}

.login-shell__input--password {
    padding-right: 48px;
}

.login-shell__toggle {
    position: absolute;
    right: var(--gs-space-2);
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--gs-text-muted);
    cursor: pointer;
    border-radius: var(--gs-radius-sm);
    transition:
        color 150ms ease,
        background 150ms ease;
}

.login-shell__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.login-shell__toggle:focus-visible {
    color: var(--gs-text);
    background: var(--gs-primary-light);
}

@media (hover: hover) and (pointer: fine) {
    .login-shell__toggle:hover:not(:disabled) {
        color: var(--gs-text);
        background: var(--gs-primary-light);
    }
}

.login-shell__toggle:focus-visible {
    outline: 2px solid var(--gs-primary);
    outline-offset: 2px;
}

.login-shell__toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Remember-me checkbox row.
   width:max-content + nowrap span keeps the label on a single line and
   lets the row sit left-aligned inside the column-flex form (previously
   the inline-flex was being squeezed and "BENİ HATIRLA" wrapped). */
.login-shell__remember {
    display: inline-flex;
    align-items: center;
    gap: var(--gs-space-3);
    margin-top: var(--gs-space-1);
    padding-top: var(--gs-space-2);
    color: var(--gs-text-muted);
    font-size: var(--gs-text-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    width: max-content;
    align-self: flex-start;
    user-select: none;
}

.login-shell__remember > span {
    white-space: nowrap;
    line-height: 1.2;
}

.login-shell__checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--gs-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ---------- Submit button ---------- */
.login-shell__submit {
    width: 100%;
    margin-top: var(--gs-space-2);
    /* Reserve a stable min-height so spinner/text swap doesn't shift layout (audit H7) */
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--gs-space-2);
    background: var(--gs-primary);
    color: var(--gs-text-inverse);
    border: none;
    border-radius: var(--gs-radius-md);
    padding: 14px var(--gs-space-4);
    font-family: var(--gs-font-heading, "Space Grotesk", sans-serif);
    font-size: var(--gs-text-base);
    font-weight: 700;
    cursor: pointer;
    transition:
        background-color 200ms ease,
        transform 100ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .login-shell__submit:hover:not(:disabled) {
        background: var(--gs-primary-hover);
    }
}

.login-shell__submit:active:not(:disabled) {
    transform: scale(0.99);
}

.login-shell__submit:focus-visible {
    outline: 2px solid var(--gs-primary);
    outline-offset: 2px;
}

.login-shell__submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-shell__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-top-color: var(--gs-text-inverse);
    border-radius: 50%;
    animation: login-shell-spin 0.8s linear infinite;
}

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

/* ---------- Forgot password / links ---------- */
.login-shell__links {
    text-align: center;
    margin-top: var(--gs-space-2);
    padding-top: var(--gs-space-1);
}

.login-shell__link {
    color: var(--gs-text-muted);
    text-decoration: none;
    font-size: var(--gs-text-sm);
    font-weight: 500;
    transition: color 150ms ease;
}

.login-shell__link:focus-visible {
    color: var(--gs-primary);
    text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
    .login-shell__link:hover {
        color: var(--gs-primary);
        text-decoration: underline;
    }
}

.login-shell__link:focus-visible {
    outline: 2px solid var(--gs-primary);
    outline-offset: 2px;
    border-radius: var(--gs-radius-sm);
}

/* ---------- Footer ---------- */
.login-shell__footer {
    margin-top: var(--gs-space-6);
    padding-top: var(--gs-space-5);
    border-top: 1px solid var(--gs-border);
    text-align: center;
}

.login-shell__footer p {
    color: var(--gs-text-muted);
    font-size: var(--gs-text-sm);
    margin: 0;
}

/* ---------- Validation / error / lockout ---------- */
.login-shell__validation {
    color: var(--gs-danger);
    font-size: var(--gs-text-sm);
    margin-top: var(--gs-space-2);
    line-height: 1.35;
}

.login-shell__error,
.login-shell__lockout {
    display: flex;
    align-items: center;
    gap: var(--gs-space-2);
    padding: var(--gs-space-3) var(--gs-space-4);
    border-radius: var(--gs-radius-md);
    font-size: var(--gs-text-base);
    border: 1px solid var(--gs-danger-border);
    background: var(--gs-danger-bg);
    color: var(--gs-danger);
    animation: login-shell-shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.login-shell__lockout {
    border-color: var(--gs-warning-border);
    background: var(--gs-warning-bg);
    color: var(--gs-warning);
    animation: none;
}

@keyframes login-shell-shake {
    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
        transform: translate3d(-3px, 0, 0);
    }
    40%,
    60% {
        transform: translate3d(3px, 0, 0);
    }
}

/* ---------- Hero panel (desktop ≥1024px) ---------- */
.login-shell__hero {
    display: none;
}

.login-shell__hero-content {
    max-width: 480px;
    color: var(--gs-text-inverse);
    /* Wave 7 hero refinement — content is positioned above the dot
       texture and below the bottom yellow accent line via z-index. */
    position: relative;
    z-index: 2;
}

.login-shell__hero-mark {
    /* Pencil-style brand mark: oversized monogram on a yellow square,
       sitting above the headline. Mirrors the corner registration marks
       used elsewhere in the brand SVGs. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 0 var(--gs-space-5) 0;
    background: var(--gs-text-inverse);
    color: var(--gs-primary);
    font-family: var(--gs-font-heading, "Space Grotesk", sans-serif);
    font-weight: 900;
    font-size: 56px;
    letter-spacing: -0.04em;
    line-height: 1;
    border-radius: 6px;
    box-shadow: 0 8px 0 0 rgba(0, 0, 0, 0.15);
}

.login-shell__hero-title {
    font-family: var(--gs-font-heading, "Space Grotesk", sans-serif);
    font-size: var(--gs-text-3xl);
    font-weight: 700;
    margin: 0 0 var(--gs-space-4) 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.login-shell__hero-tagline {
    font-size: var(--gs-text-lg);
    line-height: 1.55;
    margin: 0;
    opacity: 0.85;
}

/* Pencil identity tagline — uppercase mono with strong tracking and
   bullet dividers between modules. */
.login-shell__hero-modules {
    margin: var(--gs-space-6) 0 0 0;
    padding: 0;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: var(--gs-space-3);
    color: var(--gs-text-inverse);
    font-family: var(--gs-font-mono, "IBM Plex Mono", monospace);
    font-size: var(--gs-text-sm);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.92;
}

.login-shell__hero-modules li {
    display: inline-flex;
    align-items: center;
    gap: var(--gs-space-3);
}

.login-shell__hero-modules li + li::before {
    content: "•";
    color: var(--gs-text-inverse);
    opacity: 0.55;
    font-size: 1.4em;
    line-height: 0;
    margin-right: var(--gs-space-1);
}

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
    .login-shell {
        grid-template-columns: minmax(420px, 1fr) 1.1fr;
    }

    .login-shell__form {
        padding: var(--gs-space-12) var(--gs-space-10);
        max-width: none;
        margin: 0;
        align-items: center;
    }

    .login-shell__brand {
        width: 100%;
        max-width: 420px;
    }

    .login-shell__hero {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--gs-space-12);
        position: relative;
        overflow: hidden;
        background:
            radial-gradient(
                circle at 20% 20%,
                rgba(255, 214, 0, 0.18) 0%,
                transparent 55%
            ),
            radial-gradient(
                circle at 80% 80%,
                rgba(255, 214, 0, 0.1) 0%,
                transparent 55%
            ),
            var(--gs-primary);
    }

    /* Wave 7: subtle dot texture over the hero panel — Pencil identity
       hallmark. The dots use the carbon-black ink color so they read as
       printed dots on yellow tape. ~10% intensity. */
    .login-shell__hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: radial-gradient(
            circle,
            rgba(15, 15, 15, 0.18) 1px,
            transparent 1px
        );
        background-size: 28px 28px;
        background-position: 0 0;
        pointer-events: none;
        z-index: 0;
    }

    /* Wave 7: 4px ink-black underline at the bottom of the hero — gives
       the panel an industrial taped-edge feel and grounds the hero. */
    .login-shell__hero::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 4px;
        background: var(--gs-text-inverse);
        opacity: 0.85;
        pointer-events: none;
        z-index: 1;
    }

    .login-shell__title {
        font-size: var(--gs-text-2xl);
        letter-spacing: 2px;
    }
}

@media (min-width: 1440px) {
    .login-shell__form {
        padding: var(--gs-space-16);
    }

    .login-shell__hero-title {
        font-size: var(--gs-text-4xl);
    }
}

@media (max-width: 480px) {
    .login-shell__form {
        padding: var(--gs-space-5) var(--gs-space-4);
    }

    .login-shell__brand {
        margin-bottom: var(--gs-space-6);
    }

    .login-shell__title {
        font-size: var(--gs-text-xl);
        letter-spacing: 0.5px;
    }
}
