﻿/* ========================================================================================
   TELA DE LOGIN - DESIGN ULTRA MODERNO SENAC
   Sistema Quadro Horário
   ======================================================================================== */

/* ------------------------
   VARIÁVEIS EXCLUSIVAS DO LOGIN
   ------------------------ */
:root {
    --login-primary: #004A8D;
    --login-primary-dark: #003A6D;
    --login-accent: #F7941D;
    --login-accent-light: #FDC180;
    --login-bg-start: #f0f5fb;
    --login-bg-end: #e3f2fd;
    --login-card-shadow: 0 24px 64px rgba(0, 58, 109, 0.16);
    --login-input-focus: 0 0 0 4px rgba(0, 74, 141, 0.08);
}

/* ------------------------
   PÁGINA DE LOGIN - ESTILOS BASE
   ------------------------ */
body.login-page {
    background: linear-gradient(135deg, var(--login-bg-start) 0%, var(--login-bg-end) 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Padrão geométrico sutil no fundo */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 74, 141, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 148, 29, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Oculta header e rodapé na página de login */
body.login-page .header,
body.login-page .rodape,
body.login-page .hideSkiplink {
    display: none !important;
}

/* Sobrescreve completamente o estilo do .page para ocupar toda a tela */
body.login-page .page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
}

/* Sobrescreve completamente o estilo do .main para ocupar toda a tela */
body.login-page .main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: transparent !important;
}

/* ------------------------
   WRAPPER E CARD
   ------------------------ */
.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
    position: relative;
}

.login-card.card {
    width: 100%;
    max-width: 540px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--login-card-shadow);
    border-top: 8px solid var(--login-primary);
    box-sizing: border-box;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 80px rgba(0, 58, 109, 0.20);
}

/* Animação de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove estilos padrão do fieldset */
.login-card.card fieldset {
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
}

.login-card.card legend.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------
   FIX PARA TABELA GERADA PELO ASP.NET LOGIN
   ------------------------ */
/* Força o controle Login do ASP.NET a ocupar largura total */
#MainContent_LoginUser {
    width: 100% !important;
    display: block !important;
}

/* Remove estilos de tabela gerada pelo ASP.NET */
#MainContent_LoginUser table {
    width: 100% !important;
    border: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: transparent !important;
}

#MainContent_LoginUser table tr,
#MainContent_LoginUser table td {
    width: 100% !important;
    display: block !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* ------------------------
   NOME DA TELA (Cabeçalho interno)
   ------------------------ */
.NomeTela {
    display: block;
    text-align: center;
    margin: 0 0 18px 0;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--login-primary) 0%, var(--login-primary-dark) 100%);
    color: #ffffff;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    box-shadow: 0 12px 30px rgba(0, 74, 141, 0.16);
    max-width: 100%;
    box-sizing: border-box;
}

/* variante para quando precisar ser mais discreta (classe adicional) */
.NomeTela--small {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: 0 6px 16px rgba(0, 74, 141, 0.08);
}

/* Acessibilidade: contraste e foco */
.NomeTela:focus,
.NomeTela:focus-visible {
    outline: 3px solid rgba(247, 148, 29, 0.12);
    outline-offset: 3px;
}

/* ------------------------
   BRANDING E TÍTULO
   ------------------------ */
.brand {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--login-primary);
    text-align: center;
    margin: 0 0 12px 0;
    font-variant: normal;
    text-transform: none;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.brand-year {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--login-accent);
    background: linear-gradient(135deg, var(--login-accent), var(--login-accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ------------------------
   INTRODUÇÃO
   ------------------------ */
.intro {
    text-align: center;
    color: #5a6c7d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.intro a {
    color: var(--login-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.intro a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--login-accent);
    transition: width 0.3s ease;
}

.intro a:hover {
    color: var(--login-accent);
}

.intro a:hover::after {
    width: 100%;
}

/* ------------------------
   CAMPOS DE FORMULÁRIO
   ------------------------ */
.accountInfo {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.field {
    margin-bottom: 32px;
    width: 100%;
    box-sizing: border-box;
}

.field label {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

/* Campos de input ocupando 100% da largura e altura aumentada */
.field .input,
.field .textEntry,
.field .passwordEntry {
    width: 100% !important;
    max-width: 100% !important;
    height: 72px;
    padding: 0 24px;
    border: 2px solid rgba(0, 74, 141, 0.12);
    border-radius: 16px;
    font-size: 1.5rem;
    color: #2c3e50;
    background: linear-gradient(145deg, #ffffff, #fafbfc);
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: block;
}

.field .input::placeholder,
.field .textEntry::placeholder,
.field .passwordEntry::placeholder {
    color: #9ca3af;
    opacity: 1;
    font-size: 1.25rem;
}

.field .input:focus,
.field .textEntry:focus,
.field .passwordEntry:focus {
    outline: none;
    border-color: var(--login-primary);
    background: #ffffff;
    box-shadow: var(--login-input-focus), 0 12px 32px rgba(0, 74, 141, 0.08);
    transform: translateY(-2px);
}

/* Efeito de label flutuante simulado com placeholder */
.field .input:not(:placeholder-shown),
.field .textEntry:not(:placeholder-shown),
.field .passwordEntry:not(:placeholder-shown) {
    border-color: var(--login-primary);
}

/* ------------------------
   PASSWORD TOGGLE
   ------------------------ */
.password-wrapper {
    position: relative;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.password-wrapper .input,
.password-wrapper .passwordEntry {
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 130px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(0, 74, 141, 0.06), rgba(0, 74, 141, 0.04));
    border: 1px solid rgba(0, 74, 141, 0.12);
    color: var(--login-primary);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.password-toggle:hover {
    background: linear-gradient(135deg, rgba(0, 74, 141, 0.10), rgba(0, 74, 141, 0.08));
    border-color: var(--login-primary);
    transform: translateY(-50%) scale(1.05);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.98);
}

/* ------------------------
   REMEMBER ME E FORGOT PASSWORD
   ------------------------ */
.inline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remember input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--login-primary);
}

.remember label {
    font-size: 0.95rem;
    color: #5a6c7d;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* Link Esqueceu a senha */
.forgot-password {
    display: flex;
    align-items: center;
}

.forgot-password-link {
    font-size: 0.95rem;
    color: var(--login-accent);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px 8px;
    border-radius: 6px;
}

.forgot-password-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--login-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.forgot-password-link:hover {
    color: var(--login-primary);
    background: rgba(247, 148, 29, 0.08);
}

.forgot-password-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.forgot-password-link:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 2px;
}

/* ------------------------
   BOTÕES ULTRA MODERNOS
   ------------------------ */
.actions {
    display: flex;
    gap: 14px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    height: 64px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

/* Efeito de ripple nos botões */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Botão Primary - Ultra Moderno */
.btn-primary {
    background: linear-gradient(135deg, var(--login-primary-dark) 0%, var(--login-primary) 50%, #0066b3 100%);
    background-size: 200% 200%;
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(0, 74, 141, 0.24);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 74, 141, 0.32);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 8px 20px rgba(0, 74, 141, 0.20);
}

/* Botão Ghost - Contorno Moderno */
.btn-ghost {
    background: transparent;
    border: 2px solid rgba(0, 74, 141, 0.20);
    color: var(--login-primary);
    box-shadow: 0 4px 16px rgba(0, 74, 141, 0.08);
}

.btn-ghost:hover {
    background: rgba(0, 74, 141, 0.04);
    border-color: var(--login-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 74, 141, 0.12);
}

.btn-ghost:active {
    transform: translateY(-1px);
    background: rgba(0, 74, 141, 0.08);
}

/* ------------------------
   VALIDAÇÃO E MENSAGENS
   ------------------------ */
.failureNotification {
    background: linear-gradient(135deg, #fee, #fdd);
    border-left: 4px solid #d9534f;
    color: #d9534f;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 16px 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.validation-summary {
    background: linear-gradient(135deg, #fff5f5, #fee);
    border: 1px solid rgba(217, 83, 79, 0.2);
    border-left: 4px solid #d9534f;
    color: #d9534f;
    font-size: 0.95rem;
    padding: 18px 20px;
    border-radius: 10px;
    margin: 20px 0;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.validation-summary ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.validation-summary li {
    margin: 4px 0;
}

/* ------------------------
   RESPONSIVIDADE
   ------------------------ */
@media (max-width: 600px) {
    .login-card.card {
        padding: 32px 24px;
        border-radius: 20px;
        max-width: 100%;
    }

    .brand {
        font-size: 1.5rem;
    }

    .brand-year {
        display: block;
        margin: 8px 0 0 0;
        font-size: 0.85rem;
    }

    .intro {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    .field {
        margin-bottom: 24px;
    }

    .field label {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .field .input,
    .field .textEntry,
    .field .passwordEntry {
        height: 64px;
        font-size: 1.05rem;
        padding: 0 20px;
    }

    .field .input::placeholder,
    .field .textEntry::placeholder,
    .field .passwordEntry::placeholder {
        font-size: 0.95rem;
    }

    .password-wrapper .input,
    .password-wrapper .passwordEntry {
        padding-right: 115px;
    }

    .password-toggle {
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    .inline-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .forgot-password {
        width: 100%;
    }

    .forgot-password-link {
        font-size: 0.9rem;
    }

    .actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        height: 58px;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .login-wrapper {
        padding: 16px 12px;
    }

    .login-card.card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .brand {
        font-size: 1.3rem;
    }

    .field .input,
    .field .textEntry,
    .field .passwordEntry {
        height: 60px;
        font-size: 1rem;
        padding: 0 18px;
    }

    .field .input::placeholder,
    .field .textEntry::placeholder,
    .field .passwordEntry::placeholder {
        font-size: 0.9rem;
    }

    .password-wrapper .input,
    .password-wrapper .passwordEntry {
        padding-right: 105px;
    }

    .password-toggle {
        font-size: 0.8rem;
        padding: 9px 14px;
    }

    .forgot-password-link {
        font-size: 0.85rem;
    }

    .btn {
        height: 54px;
        font-size: 0.95rem;
    }
}

/* ------------------------
   MODO ESCURO (Futuro)
   ------------------------ */
@media (prefers-color-scheme: dark) {
    /* Suporte para modo escuro pode ser adicionado aqui */
}

/* ------------------------
   ACESSIBILIDADE
   ------------------------ */
.btn:focus-visible,
.field .input:focus-visible,
.field .textEntry:focus-visible,
.field .passwordEntry:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid var(--login-accent);
    outline-offset: 2px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .login-card.card {
        border: 2px solid var(--login-primary);
    }

    .field .input,
    .field .textEntry,
    .field .passwordEntry {
        border-width: 3px;
    }
}