:root {
    --tgu-red: #c8102e;
    --tgu-red-dark: #9e0c24;
    --tgu-black: #1a1a1a;
    --tgu-gray: #6b7280;
    --tgu-border: #e5e7eb;
    --tgu-bg: #f3f4f6;
    --tgu-white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    color: var(--tgu-black);
    background: var(--tgu-bg);
    line-height: 1.5;
}

a { color: var(--tgu-red); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(135deg, rgba(200, 16, 46, 0.08), rgba(255, 255, 255, 0.9)),
        radial-gradient(circle at top right, rgba(200, 16, 46, 0.12), transparent 45%);
}

.login-shell {
    width: min(920px, 94%);
    margin: 48px auto 24px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--tgu-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.login-shell-sm { width: min(780px, 94%); }

.brand-panel {
    background: linear-gradient(160deg, #c8102e 0%, #8a0b20 100%);
    color: #fff;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.brand-logo {
    width: min(280px, 100%);
    height: auto;
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
}

.brand-tagline {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand-desc {
    font-size: 0.95rem;
    opacity: 0.92;
}

.form-panel {
    padding: 40px 32px;
}

.form-title {
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.form-subtitle {
    color: var(--tgu-gray);
    margin-bottom: 22px;
}

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    border: 1px solid var(--tgu-border);
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--tgu-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15);
}

.form-help {
    display: block;
    margin-top: 4px;
    color: var(--tgu-gray);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, background 0.2s, opacity 0.2s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--tgu-red); color: #fff; }
.btn-primary:hover { background: var(--tgu-red-dark); color: #fff; }

.btn-secondary {
    background: #fff;
    color: var(--tgu-black);
    border: 1px solid var(--tgu-border);
}

.btn-danger { background: #b91c1c; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }

.admin-link {
    margin-top: 18px;
    color: var(--tgu-gray);
    font-size: 0.9rem;
}

.site-footer {
    text-align: center;
    color: var(--tgu-gray);
    font-size: 0.85rem;
    padding: 0 16px 28px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-group.error .form-input { border-color: #dc2626; }
.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--tgu-border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: #fafafa;
    font-weight: 700;
    color: #374151;
}

.text-center { text-align: center; }
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 800px) {
    .login-shell,
    .login-shell-sm {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }
    .brand-panel { padding: 28px 22px; }
    .form-panel { padding: 28px 22px; }
}

/* Lazy Loader Overlay */
body.tgu-loader-open { overflow: hidden; }

.tgu-lazy-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 26, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tgu-lazy-loader.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tgu-lazy-loader__box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 34px;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    border-top: 4px solid var(--tgu-red);
}

.tgu-lazy-loader__spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 3px solid #f3d5db;
    border-top-color: var(--tgu-red);
    animation: tguSpin 0.75s linear infinite;
}

.tgu-lazy-loader__text {
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
}

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