:root {
    --tm-primary: #2b5fd9;
    --tm-primary-dark: #1e46ad;
    --tm-accent: #16b8a6;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.tm-login-wrap {
    min-height: 100vh;
    display: flex;
}

.tm-brand-panel {
    position: relative;
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, #16224a 0%, #1e46ad 55%, #2b5fd9 100%);
    background-size: 220% 220%;
    animation: tmGradientMove 12s ease infinite;
}
@keyframes tmGradientMove {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tm-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .35;
    animation: tmFloat 9s ease-in-out infinite;
}
.tm-blob-1 { width: 320px; height: 320px; background: #16b8a6; top: -80px; left: -80px; }
.tm-blob-2 { width: 260px; height: 260px; background: #5b8dff; bottom: -60px; right: -40px; animation-delay: 2s; }
.tm-blob-3 { width: 180px; height: 180px; background: #ffffff; bottom: 20%; left: 30%; opacity: .12; animation-delay: 4s; }

@keyframes tmFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-24px) scale(1.06); }
}

.tm-brand-content { position: relative; z-index: 2; animation: tmSlideIn .7s cubic-bezier(.22,1,.36,1) both; }

@keyframes tmSlideIn {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.tm-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
}
.tm-brand-logo .dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--tm-accent);
    box-shadow: 0 0 0 6px rgba(22,184,166,.25);
}

.tm-brand-panel h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1.25;
    margin-bottom: 1rem;
}
.tm-brand-panel p {
    font-size: 1.02rem;
    color: rgba(255,255,255,.82);
    max-width: 420px;
    line-height: 1.6;
}

.tm-brand-stats {
    display: flex;
    gap: 2.2rem;
    margin-top: 3rem;
}
.tm-brand-stats div strong {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
}
.tm-brand-stats div span {
    font-size: .8rem;
    color: rgba(255,255,255,.68);
}

.tm-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #f3f5fa;
}

.tm-login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(30,41,90,.12);
    padding: 2.6rem 2.2rem;
    animation: tmCardIn .55s cubic-bezier(.22,1,.36,1) both;
    animation-delay: .1s;
}
@keyframes tmCardIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tm-login-card h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-bottom: .3rem;
}
.tm-login-card .tm-sub {
    color: #6b7280;
    font-size: .92rem;
    margin-bottom: 1.8rem;
}

.tm-field { position: relative; margin-bottom: 1.3rem; }
.tm-field label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    margin-bottom: .4rem;
    color: #1c2333;
}
.tm-field input {
    width: 100%;
    padding: .75rem 2.6rem .75rem 1rem;
    border: 1.5px solid #e7e9f2;
    border-radius: 12px;
    font-size: .95rem;
    transition: border-color .18s, box-shadow .18s;
    background: #fbfcfe;
}
.tm-field input:focus {
    outline: none;
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 4px rgba(43,95,217,.12);
    background: #fff;
}
.tm-field .tm-icon {
    position: absolute;
    right: .95rem;
    top: 2.35rem;
    color: #9aa3b5;
    cursor: pointer;
    font-size: 1.05rem;
}

.tm-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: .87rem;
}
.tm-row-between label { color: #4b5563; }

.tm-btn-login {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: .8rem 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--tm-primary), var(--tm-primary-dark));
    box-shadow: 0 10px 24px rgba(43,95,217,.30);
    transition: transform .18s, box-shadow .18s, background .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.tm-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(43,95,217,.4);
}
.tm-btn-login:active { transform: translateY(0) scale(.98); }
.tm-btn-login:disabled { opacity: .75; cursor: not-allowed; transform: none; }

.tm-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tmSpin .7s linear infinite;
    display: none;
}
@keyframes tmSpin { to { transform: rotate(360deg); } }

.tm-alert-error {
    background: #fdecea;
    color: #a02622;
    border-radius: 12px;
    padding: .75rem 1rem;
    font-size: .88rem;
    margin-bottom: 1.2rem;
    animation: tmShake .4s cubic-bezier(.36,.07,.19,.97) both;
    display: flex;
    align-items: center;
    gap: .5rem;
}
@keyframes tmShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.tm-footer-note {
    text-align: center;
    font-size: .8rem;
    color: #9aa3b5;
    margin-top: 1.6rem;
}

@media (max-width: 991.98px) {
    .tm-login-wrap { flex-direction: column; }
    .tm-brand-panel { display: none; }
    .tm-form-panel { padding: 2rem 1.2rem 3rem; }
    .tm-login-card { padding: 2rem 1.5rem; margin-top: 0; }
}

@media (max-width: 420px) {
    .tm-login-card { border-radius: 16px; }
}
