/*******************************************************************************
 *   Estilo moderno e responsivo da página de login do Gerenciador de Licenças.
 *   Escopo: aplicado SOMENTE ao login.php (via classe .tm-login no body).
 *   Coexiste com estilogeo.css sem sobrescrever — não usa #contentDiv,
 *   .topDivWhite ou demais seletores antigos.
 *******************************************************************************/

:root {
    --tm-blue:        #4169E1;
    --tm-blue-dark:   #3454c4;
    --tm-blue-soft:   rgba(65, 105, 225, 0.15);
    --tm-text:        #1f2937;
    --tm-text-muted:  #6b7280;
    --tm-border:      #e3e8ef;
    --tm-bg-soft:     #f7f8fa;
    --tm-bg-page:     #f4f7fc;
    --tm-shadow:      0 8px 24px rgba(15, 39, 90, 0.08);
    --tm-radius:      16px;
    --tm-radius-sm:   8px;
}

body.tm-login,
body.tm-login * { box-sizing: border-box; }

body.tm-login {
    margin: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(180deg, var(--tm-bg-page) 0%, #ffffff 70%);
    color: var(--tm-text);
    min-height: 100vh;
}

/* ==========  Faixa superior (bandeiras) ========== */
.tm-topbar {
    background: var(--tm-bg-soft);
    border-bottom: 1px solid var(--tm-border);
}
.tm-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.tm-topbar-logo { display: none; }    /* visível só no mobile */
.tm-topbar-logo img { height: 28px; display: block; }

.tm-flags { display: inline-flex; gap: 8px; align-items: center; }
.tm-flag {
    display: inline-flex;
    border-radius: 3px;
    overflow: hidden;
    transition: opacity .2s, transform .15s;
    line-height: 0;
}
.tm-flag:hover { opacity: .75; transform: translateY(-1px); }
.tm-flag img { display: block; height: 18px; border: 0; }

/* ==========  Cabeçalho com logo + menu ========== */
.tm-header {
    background: #ffffff;
    border-bottom: 1px solid var(--tm-border);
}
.tm-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.tm-logo img { height: 44px; display: block; }

.tm-menu {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tm-menu a {
    color: #1f2937;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}
.tm-menu a:hover { color: var(--tm-blue); }
.tm-menu img { height: 18px; }

/* ==========  Cartão de login ========== */
.tm-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 24px;
    display: flex;
    justify-content: center;
}
.tm-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: var(--tm-radius);
    box-shadow: var(--tm-shadow);
    padding: 40px 36px;
}
.tm-card-title {
    font-size: 26px;
    color: var(--tm-text);
    margin: 0 0 6px;
    font-weight: 700;
    line-height: 1.25;
}
.tm-card-subtitle {
    font-size: 15px;
    color: var(--tm-text-muted);
    margin: 0 0 28px;
    font-weight: 500;
    line-height: 1.4;
}

/* ==========  Campos do formulário ========== */
.tm-field { margin-bottom: 18px; }
.tm-field label {
    display: block;
    font-size: 13px;
    color: var(--tm-text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.tm-field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;     /* 16px evita zoom automático no iOS */
    color: var(--tm-text);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-sm);
    background: #fafbfc;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}
.tm-field input:focus {
    border-color: var(--tm-blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--tm-blue-soft);
}

.tm-forgot {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--tm-blue);
    text-decoration: none;
    margin: -6px 0 24px;
    transition: color .2s;
}
.tm-forgot:hover { color: var(--tm-blue-dark); text-decoration: underline; }

.tm-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: var(--tm-blue);
    border: none;
    border-radius: var(--tm-radius-sm);
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .5px;
    transition: background .2s, box-shadow .2s, transform .1s;
}
.tm-submit:hover {
    background: var(--tm-blue-dark);
    box-shadow: 0 6px 16px rgba(65, 105, 225, 0.3);
}
.tm-submit:active { transform: translateY(1px); }

/* ==========  Modal jQuery UI (popup "Recuperar senha") ==========
   Escopo: aplicado só quando o dialog é aberto com dialogClass: "tm-modal"
   (ver recoverPasswordByEmail em js/loginjq.js). Os outros .dialog()
   genéricos (alertas) continuam com o tema antigo. */

.tm-modal.ui-dialog {
    border: none !important;
    border-radius: var(--tm-radius);
    box-shadow: 0 16px 48px rgba(15, 39, 90, 0.18);
    padding: 0;
    background: #ffffff;
    max-width: calc(100vw - 24px);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}

.tm-modal .ui-dialog-titlebar {
    background: #ffffff !important;
    border: none !important;
    border-radius: var(--tm-radius) var(--tm-radius) 0 0;
    padding: 18px 56px 8px 24px;
    color: var(--tm-text);
    font-weight: 700;
    font-size: 17px;
    position: relative;
}

.tm-modal .ui-dialog-title {
    float: none;
    padding: 0;
    margin: 0;
    width: auto;
    color: var(--tm-text);
}

.tm-modal .ui-dialog-titlebar-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    background: var(--tm-bg-soft) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    transition: background .2s;
    text-indent: 0;
    overflow: hidden;
}
.tm-modal .ui-dialog-titlebar-close:hover {
    background: var(--tm-border) !important;
}
.tm-modal .ui-dialog-titlebar-close .ui-icon {
    background-image: none !important;
    text-indent: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    position: relative;
    left: 0;
    top: 0;
}
.tm-modal .ui-dialog-titlebar-close .ui-icon::before {
    content: "\2715";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tm-text-muted);
    font-size: 14px;
    font-weight: 600;
}

.tm-modal .ui-dialog-content {
    padding: 4px 24px 24px !important;
    color: var(--tm-text);
    background: transparent !important;
}

.tm-modal-body { padding: 0; }
.tm-modal-text {
    margin: 8px 0 20px;
    color: var(--tm-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Backdrop (sombra atrás do modal) — afeta também os alertas, intencional */
.ui-widget-overlay {
    background: rgba(15, 23, 42, 0.5) !important;
    opacity: 1 !important;
}

/* ----- Conteúdo dos alertas (msg_*) — vêm como <table><img/><td>texto</td></table> */
.tm-alert .ui-dialog-titlebar {
    padding: 14px 50px 4px 20px;
}
.tm-alert .ui-dialog-content {
    padding: 4px 20px 10px !important;
}
.tm-alert .ui-dialog-content table {
    border: 0;
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.tm-alert .ui-dialog-content td {
    padding: 4px 6px;
    vertical-align: middle;
    border: 0;
    color: var(--tm-text);
    font-size: 16px;
    line-height: 1.4;
}
.tm-alert .ui-dialog-content img {
    display: block;
    max-width: 36px;
    height: auto;
}
.tm-alert .ui-dialog-buttonpane {
    padding: 4px 20px 16px !important;
}

/* ----- Barra de botões do jQuery UI (área cinza do "OK") */
.tm-modal .ui-dialog-buttonpane {
    background: transparent !important;
    border: none !important;
    padding: 8px 24px 22px !important;
    margin: 0 !important;
}
.tm-modal .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: none;
    text-align: right;
    width: 100%;
}
.tm-modal .ui-dialog-buttonpane button {
    background: var(--tm-blue) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--tm-radius-sm) !important;
    padding: 10px 28px !important;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    min-width: 90px;
    box-shadow: none;
}
.tm-modal .ui-dialog-buttonpane button:hover {
    background: var(--tm-blue-dark) !important;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}
.tm-modal .ui-dialog-buttonpane button .ui-button-text {
    padding: 0;
    line-height: 1;
}

/* ==========  Mobile (≤ 768px) ==========
   Menu desaparece. Logo migra para a faixa das bandeiras. */
@media (max-width: 768px) {
    .tm-topbar-inner {
        padding: 10px 16px;
        justify-content: space-between;
    }
    .tm-topbar-logo { display: inline-flex; }
    .tm-header { display: none; }
    .tm-main { padding: 28px 16px; }
    .tm-card { padding: 28px 22px; border-radius: 14px; }
    .tm-card-title { font-size: 22px; }
    .tm-card-subtitle { font-size: 14px; }
}
