﻿/* =====================================================================
   Trang đăng nhập TraceMarket - bố cục chia đôi (thương hiệu | biểu mẫu)
   Bảng màu đồng bộ với Dashboard: navy + xanh dương #315c93, điểm nhấn đỏ ở chữ "Market".
   Class riêng tiền tố tm- để không đụng Bootstrap / site.css.
   ===================================================================== */

:root {
    --tm-navy-950: #081a31;
    --tm-navy-900: #0c2340;
    --tm-navy-800: #12305a;
    --tm-blue: #315c93;
    --tm-blue-700: #284e7c;
    --tm-blue-300: #8fb8e8;
    --tm-red: #d7263d;
    --tm-red-on-dark: #ff7480;
    --tm-ink: #1c2b3f;
    --tm-label: #334155;
    --tm-muted: #64748b;
    --tm-line: #d5dde9;
    --tm-bg: #f3f6fb;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'SVNGilroy', 'BeVietnamPro', Arial, sans-serif;
    font-size: 1rem;
    color: var(--tm-ink);
    background: var(--tm-bg);
    -webkit-font-smoothing: antialiased;
}

.tm-login {
    display: flex;
    min-height: 100vh;
}

/* ---------- Thương hiệu (cột trái) ---------- */
.tm-login-brand {
    --tm-pad: clamp(40px, 5vw, 72px);
    position: relative;
    flex: 0 0 52%;
    max-width: 780px;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(900px 520px at 10% 0%, rgba(90, 162, 230, .26), transparent 62%), linear-gradient(160deg, var(--tm-navy-800) 0%, var(--tm-navy-900) 48%, var(--tm-navy-950) 100%);
}

    /* lưới mờ phía sau, mờ dần xuống dưới */
    .tm-login-brand::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
        background-size: 56px 56px;
        -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
        mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
        pointer-events: none;
    }

.tm-login-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-height: 100vh;
    padding: 48px var(--tm-pad) 36px;
}

.tm-spacer {
    flex: 1 1 0;
    min-height: 8px;
}

/* biểu đồ trang trí (không phải số liệu thật): chiếm phần trống giữa nội dung và dòng lưu ý, tràn sát hai mép panel */
.tm-chart-wrap {
    position: relative;
    flex: 2.4 1 0;
    min-height: 110px;
    max-height: 340px;
    margin: 0 calc(-1 * var(--tm-pad));
    pointer-events: none;
}

.tm-login-chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 78%, transparent 100%);
}

.tm-chart-grid line {
    stroke: rgba(255, 255, 255, .08);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.tm-chart-bars rect {
    fill: rgba(255, 255, 255, .07);
}

.tm-chart-line2 {
    fill: none;
    stroke: rgba(255, 255, 255, .3);
    stroke-width: 1.5;
    stroke-dasharray: 5 5;
    vector-effect: non-scaling-stroke;
}

.tm-chart-area {
    fill: url(#tmArea);
}

.tm-chart-line {
    fill: none;
    stroke: #7db8f2;
    stroke-width: 2.5;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

/* logo */
.tm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tm-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #4b86c6, var(--tm-blue));
    box-shadow: 0 6px 16px rgba(49, 92, 147, .45);
}

.tm-brand-name {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
}

.tm-accent {
    color: var(--tm-red-on-dark);
}

/* nội dung giới thiệu */
.tm-hero {
    max-width: 520px;
}

.tm-eyebrow {
    margin: 0 0 14px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tm-blue-300);
}

.tm-hero-title {
    margin: 0 0 36px;
    font-size: clamp(1.6rem, 2.3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.28;
    color: #fff;
}

.tm-features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

    .tm-features li {
        display: flex;
        align-items: flex-start;
        gap: 16px;
    }

    .tm-features strong {
        display: block;
        margin-bottom: 3px;
        font-size: 1rem;
        font-weight: 700;
        color: #fff;
    }

    .tm-features li > div > span {
        display: block;
        font-size: .9rem;
        line-height: 1.5;
        color: rgba(255, 255, 255, .72);
    }

.tm-feature-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 1rem;
    color: var(--tm-blue-300);
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
}

.tm-disclaimer {
    margin: 0;
    margin-top: -8px;
    font-size: .8rem;
    color: rgba(255, 255, 255, .62);
}

/* ---------- Biểu mẫu (cột phải) ---------- */
.tm-login-pane {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px 24px;
    min-width: 0;
}

.tm-login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 32px;
    background: #fff;
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 35, 64, .04), 0 14px 36px rgba(15, 35, 64, .08);
}

.tm-brand-compact {
    display: none;
    margin-bottom: 26px;
    color: var(--tm-navy-900);
}

    .tm-brand-compact .tm-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .tm-brand-compact .tm-brand-name {
        font-size: 1.4rem;
    }

    .tm-brand-compact .tm-accent {
        color: var(--tm-red);
    }

.tm-form-title {
    margin: 0 0 6px;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--tm-navy-900);
}

.tm-form-sub {
    margin: 0 0 26px;
    font-size: .95rem;
    color: var(--tm-muted);
}

.tm-form-group {
    margin-bottom: 18px;
}

.tm-label {
    display: block;
    margin-bottom: 6px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--tm-label);
}

.tm-field {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 6px 0 14px;
    background: #fff;
    border: 1px solid #c5d0df;
    border-radius: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .tm-field:focus-within {
        border-color: var(--tm-blue);
        box-shadow: 0 0 0 3px rgba(49, 92, 147, .18);
    }

    .tm-field input {
        flex: 1 1 auto;
        min-width: 0;
        height: 100%;
        padding: 0 10px;
        font: inherit;
        font-size: 1rem;
        color: var(--tm-ink);
        background: transparent;
        border: 0;
        outline: 0;
    }

        .tm-field input::placeholder {
            color: #94a3b8;
        }

.tm-field-icon {
    flex: 0 0 auto;
    width: 16px;
    text-align: center;
    font-size: .9rem;
    color: #8a99ad;
}

.tm-field:focus-within .tm-field-icon {
    color: var(--tm-blue);
}

.tm-field-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #7b8aa0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

    .tm-field-btn:hover {
        color: var(--tm-blue);
        background: #eef3fa;
    }

    .tm-field-btn:focus-visible {
        outline: 2px solid var(--tm-blue);
        outline-offset: 1px;
    }

.tm-caps {
    margin-top: 8px;
    font-size: .82rem;
    color: #b45309;
}

.tm-login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 11px 14px;
    font-size: .9rem;
    color: #9b1c2c;
    background: #fdecee;
    border: 1px solid #f6c6cc;
    border-radius: 8px;
}

    .tm-login-error i {
        margin-top: 3px;
    }

.tm-btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    margin-top: 8px;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--tm-blue);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(49, 92, 147, .28);
    transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

    .tm-btn-login i {
        font-size: .85rem;
        transition: transform .15s ease;
    }

    .tm-btn-login:hover {
        background: var(--tm-blue-700);
        box-shadow: 0 8px 18px rgba(49, 92, 147, .34);
    }

        .tm-btn-login:hover i {
            transform: translateX(3px);
        }

    .tm-btn-login:active {
        transform: translateY(1px);
    }

    .tm-btn-login:focus-visible {
        outline: 3px solid rgba(49, 92, 147, .4);
        outline-offset: 2px;
    }

.tm-secure-note {
    margin: 22px 0 0;
    padding-top: 18px;
    text-align: center;
    font-size: .82rem;
    color: var(--tm-muted);
    border-top: 1px solid #e6ebf3;
}

    .tm-secure-note i {
        margin-right: 6px;
        color: var(--tm-blue);
    }

.tm-copyright {
    margin: 22px 0 0;
    font-size: .8rem;
    color: var(--tm-muted);
}

/* ---------- Màn hình nhỏ: bỏ cột thương hiệu, chỉ còn biểu mẫu ---------- */
@media (max-width: 991.98px) {
    .tm-login-brand {
        display: none;
    }

    .tm-brand-compact {
        display: flex;
    }

    .tm-login-pane {
        justify-content: flex-start;
        padding-top: 7vh;
    }
}

@media (max-width: 480px) {
    .tm-login-pane {
        padding: 24px 16px 20px;
    }

    .tm-login-card {
        padding: 28px 22px 24px;
        border-radius: 12px;
    }

    .tm-form-title {
        font-size: 1.5rem;
    }
}

/* màn hình thấp (laptop nhỏ): thu gọn khoảng cách để không phải cuộn */
@media (min-width: 992px) and (max-height: 800px) {
    .tm-login-brand-inner {
        padding-top: 32px;
        padding-bottom: 24px;
        gap: 20px;
    }

    .tm-hero-title {
        margin-bottom: 22px;
    }

    .tm-features {
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-field,
    .tm-btn-login,
    .tm-btn-login i {
        transition: none;
    }
}
