/* =====================================================
   GERPAY - CSS ESPECÍFICO PARA TELA DE LOGIN
   CSS Isolado - Não depende de outros arquivos
   ===================================================== */

/* Reset e Base - Escopo isolado */
.gerpay-login-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.gerpay-login-page {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

/* Efeito de partículas/brilho no fundo */
.gerpay-login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(91, 141, 239, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(76, 175, 152, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(91, 141, 239, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

/* Container principal */
.gerpay-login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Card de login */
.gerpay-login-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

/* Logo e Header */
.gerpay-login-header {
    text-align: center;
    margin-bottom: 24px;
}

.gerpay-login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #5b8def 0%, #4cafa0 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 10px 30px rgba(91, 141, 239, 0.4);
    transition: transform 0.3s ease;
}

.gerpay-login-logo:hover {
    transform: scale(1.05);
}

.gerpay-login-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.gerpay-login-title {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.gerpay-login-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* Indicador de etapas */
.gerpay-login-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.gerpay-login-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.gerpay-login-step.inactive {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gerpay-login-step.active {
    background: linear-gradient(135deg, #5b8def 0%, #4a7bd4 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(91, 141, 239, 0.5);
}

.gerpay-login-step.completed {
    background: linear-gradient(135deg, #4cafa0 0%, #3d9488 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 152, 0.5);
}

.gerpay-login-step-line {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: background 0.4s ease;
}

.gerpay-login-step-line.active {
    background: linear-gradient(90deg, #4cafa0 0%, #5b8def 100%);
}

/* Descrição da etapa */
.gerpay-login-step-description {
    text-align: center;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(91, 141, 239, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(91, 141, 239, 0.2);
}

.gerpay-login-step-description p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    margin: 0;
}

.gerpay-login-step-description .gerpay-user-name {
    color: #5b8def;
    font-weight: 600;
}

/* Formulários */
.gerpay-login-form {
    display: none;
}

.gerpay-login-form.active {
    display: block;
    animation: gerpayFadeIn 0.5s ease;
}

@keyframes gerpayFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grupos de input */
.gerpay-input-group {
    margin-bottom: 14px;
}

.gerpay-input-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gerpay-input-wrapper {
    position: relative;
}

.gerpay-input-wrapper svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s ease;
    pointer-events: none;
}

.gerpay-input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.gerpay-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.gerpay-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #5b8def;
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.2);
}

.gerpay-input:focus + svg,
.gerpay-input-wrapper:focus-within svg {
    color: #5b8def;
}

/* Toggle de senha */
.gerpay-password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.gerpay-password-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.gerpay-password-toggle svg {
    position: static;
    transform: none;
    width: 20px;
    height: 20px;
}

/* Select estilizado */
.gerpay-select {
    width: 100%;
    padding: 12px 12px 12px 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.gerpay-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #5b8def;
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b8def' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.gerpay-select option {
    background: #2a3f5f;
    color: #ffffff;
    padding: 12px;
}

/* Botões */
.gerpay-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gerpay-btn svg {
    width: 20px;
    height: 20px;
}

.gerpay-btn-primary {
    background: linear-gradient(135deg, #5b8def 0%, #4a7bd4 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(91, 141, 239, 0.35);
}

.gerpay-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(91, 141, 239, 0.45);
}

.gerpay-btn-primary:active {
    transform: translateY(0);
}

.gerpay-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gerpay-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 8px;
}

.gerpay-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Cards de tipo de acesso */
.gerpay-access-types {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 14px;
}

.gerpay-access-card {
    flex: 1;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gerpay-access-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.gerpay-access-card.selected {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.15);
}

.gerpay-access-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gerpay-access-card-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.gerpay-access-card-icon.vendas {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.gerpay-access-card-icon.caixa {
    background: linear-gradient(135deg, #4ecdc4 0%, #44b3ab 100%);
}

.gerpay-access-card-icon.gestao {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.gerpay-access-card-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.gerpay-access-card.selected .gerpay-access-card-title {
    color: #ffffff;
}

/* Mensagens de erro/sucesso */
.gerpay-alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: gerpayShake 0.5s ease;
}

@keyframes gerpayShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.gerpay-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gerpay-alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.gerpay-alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Loading spinner */
.gerpay-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: gerpaySpinner 0.8s linear infinite;
}

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

/* Footer do card */
.gerpay-login-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.gerpay-login-footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

/* Responsivo - Tablets */
@media (max-width: 768px) {
    .gerpay-login-container {
        padding: 16px;
        max-width: 100%;
    }
    
    .gerpay-login-card {
        padding: 28px 24px;
        border-radius: 20px;
        max-height: none;
    }
    
    .gerpay-login-header {
        margin-bottom: 20px;
    }
    
    .gerpay-login-logo {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }
    
    .gerpay-login-logo svg {
        width: 28px;
        height: 28px;
    }
    
    .gerpay-login-title {
        font-size: 24px;
    }
    
    .gerpay-login-subtitle {
        font-size: 12px;
    }
}

/* Responsivo - Mobile */
@media (max-width: 480px) {
    .gerpay-login-page {
        padding: 0;
        align-items: flex-start;
        min-height: 100dvh; /* Dynamic viewport height para mobile */
    }
    
    .gerpay-login-container {
        padding: 12px;
        max-width: 100%;
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .gerpay-login-card {
        padding: 24px 20px;
        border-radius: 16px;
        width: 100%;
        max-height: none;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    }
    
    .gerpay-login-header {
        margin-bottom: 16px;
    }
    
    .gerpay-login-logo {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    
    .gerpay-login-logo svg {
        width: 26px;
        height: 26px;
    }
    
    .gerpay-login-title {
        font-size: 22px;
        margin-bottom: 2px;
    }
    
    .gerpay-login-subtitle {
        font-size: 11px;
    }
    
    /* Steps */
    .gerpay-login-steps {
        margin-bottom: 16px;
        gap: 8px;
    }
    
    .gerpay-login-step {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .gerpay-login-step-line {
        width: 30px;
    }
    
    /* Descrição da etapa */
    .gerpay-login-step-description {
        padding: 8px 12px;
        margin-bottom: 14px;
    }
    
    .gerpay-login-step-description p {
        font-size: 11px;
    }
    
    /* Inputs */
    .gerpay-input-group {
        margin-bottom: 12px;
    }
    
    .gerpay-input-label {
        font-size: 10px;
        margin-bottom: 5px;
    }
    
    .gerpay-input-wrapper svg {
        left: 12px;
        width: 18px;
        height: 18px;
    }
    
    .gerpay-input,
    .gerpay-select {
        padding: 14px 14px 14px 40px;
        font-size: 16px; /* 16px evita zoom no iOS */
        border-radius: 10px;
    }
    
    .gerpay-select {
        background-position: right 10px center;
    }
    
    .gerpay-password-toggle {
        right: 12px;
    }
    
    .gerpay-password-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    /* Botões */
    .gerpay-btn {
        padding: 14px 18px;
        font-size: 13px;
        border-radius: 10px;
        gap: 6px;
    }
    
    .gerpay-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .gerpay-btn-secondary {
        margin-top: 10px;
    }
    
    /* Cards de tipo de acesso - Layout mobile */
    .gerpay-access-types {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .gerpay-access-card {
        padding: 12px 6px;
        border-radius: 10px;
        gap: 6px;
    }
    
    .gerpay-access-card-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .gerpay-access-card-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .gerpay-access-card-title {
        font-size: 10px;
    }
    
    /* Alertas */
    .gerpay-alert {
        padding: 12px 14px;
        font-size: 13px;
        gap: 10px;
        border-radius: 10px;
        margin-bottom: 16px;
    }
    
    .gerpay-alert svg {
        width: 18px;
        height: 18px;
    }
    
    /* Footer */
    .gerpay-login-footer {
        margin-top: 14px;
        padding-top: 10px;
    }
    
    .gerpay-login-footer p {
        font-size: 10px;
    }
}

/* Mobile muito pequeno (iPhone SE, etc) */
@media (max-width: 360px) {
    .gerpay-login-container {
        padding: 8px;
    }
    
    .gerpay-login-card {
        padding: 20px 16px;
    }
    
    .gerpay-login-logo {
        width: 44px;
        height: 44px;
    }
    
    .gerpay-login-logo svg {
        width: 22px;
        height: 22px;
    }
    
    .gerpay-login-title {
        font-size: 20px;
    }
    
    .gerpay-access-types {
        gap: 6px;
    }
    
    .gerpay-access-card {
        padding: 10px 4px;
    }
    
    .gerpay-access-card-icon {
        width: 28px;
        height: 28px;
    }
    
    .gerpay-access-card-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .gerpay-access-card-title {
        font-size: 9px;
    }
}

/* Landscape mode no mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .gerpay-login-page {
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .gerpay-login-container {
        min-height: auto;
    }
    
    .gerpay-login-card {
        max-height: none;
        overflow: visible;
    }
    
    .gerpay-login-header {
        margin-bottom: 12px;
    }
    
    .gerpay-login-logo {
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
    }
    
    .gerpay-login-title {
        font-size: 18px;
    }
    
    .gerpay-login-subtitle {
        display: none;
    }
    
    .gerpay-login-steps {
        margin-bottom: 10px;
    }
    
    .gerpay-login-step {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .gerpay-login-step-description {
        padding: 6px 10px;
        margin-bottom: 10px;
    }
    
    .gerpay-input-group {
        margin-bottom: 8px;
    }
    
    .gerpay-input,
    .gerpay-select {
        padding: 10px 10px 10px 36px;
    }
    
    .gerpay-btn {
        padding: 10px 16px;
    }
    
    .gerpay-access-types {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .gerpay-access-card {
        padding: 8px 4px;
        flex-direction: row;
        gap: 6px;
    }
    
    .gerpay-access-card-icon {
        width: 28px;
        height: 28px;
    }
    
    .gerpay-login-footer {
        margin-top: 10px;
        padding-top: 8px;
    }
}

/* Esconder formulários inativos com transição */
.gerpay-login-form {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.gerpay-login-form.active {
    opacity: 1;
    max-height: 1000px;
}
