@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0078D4;
    --secondary-color: #2b88d8;
    --dark-blue: #00305e;
    --light-blue: #4a9eff;
    --bg-gradient-start: #0a1628;
    --bg-gradient-end: #1e3a5f;
    --card-shadow: 0 30px 80px rgba(0, 48, 94, 0.25);
    --card-shadow-hover: 0 35px 90px rgba(0, 48, 94, 0.35);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 120, 212, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(43, 136, 216, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Notificação */
.notification {
    position: fixed;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 500px;
    width: 90%;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.notification.show {
    top: 30px;
}

.notification-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification-error {
    background: linear-gradient(135deg, #dc3545, #e63946);
}

.notification-info {
    background: linear-gradient(135deg, #0078D4, #2b88d8);
}

.notification-warning {
    background: linear-gradient(135deg, #ffc107, #ffb700);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    color: white;
}

.notification-icon {
    flex-shrink: 0;
    font-size: 32px;
    margin-right: 18px;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-text h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
}

.notification-text p {
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.5;
}

.notification-close {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    margin-left: 12px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.notification-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.notification-progress-bar {
    height: 100%;
    background: white;
    width: 100%;
    transition: width 0.1s linear;
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 20px 60px;
    position: relative;
    z-index: 1;
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    width: 100%;
    max-width: 460px;
    transition: all 0.4s ease;
    animation: cardEntrance 0.6s ease;
    position: relative;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

/* Login Steps */
.login-step {
    display: none;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.login-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    animation: stepSlideIn 0.5s ease;
}

.login-step.exit {
    opacity: 0;
    transform: translateX(30px);
}

@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Card Header - AJUSTADO COM ESPAÇAMENTO REDUZIDO */
.card-header {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
    color: white;
    padding: 25px 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerGlow 8s linear infinite;
}

@keyframes headerGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Logo - ESPAÇAMENTO REDUZIDO */
.card-header .logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: transparent;
    border-radius: 18px;
    margin-bottom: 10px;
    backdrop-filter: none;
    border: none;
    padding: 0;
    z-index: 1;
}

.card-header .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Icon Wrapper - ESPAÇAMENTO REDUZIDO */
.icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 75px;
    height: 75px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.icon-wrapper i {
    font-size: 34px;
    color: white;
}

.card-header h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.card-header p {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* Card Body */
.card-body {
    padding: 45px 40px;
}

/* Welcome Text */
.welcome-text {
    text-align: center;
    margin-bottom: 35px;
}

.welcome-text h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 10px;
}

.welcome-text p {
    font-size: 15px;
    color: #666;
    font-weight: 400;
    line-height: 1.6;
}

.welcome-text p strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Form Group */
.form-group {
    margin-bottom: 30px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: var(--primary-color);
    font-size: 18px;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.1);
}

.form-control::placeholder {
    color: #999;
    font-weight: 400;
}

.form-control:hover {
    border-color: #c5d0dc;
    background: white;
}

/* PIN Inputs */
.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.pin-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: #f8f9fa;
    color: var(--dark-blue);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.pin-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.1);
    transform: scale(1.05);
}

.pin-input:hover {
    border-color: #c5d0dc;
    background: white;
}

.pin-input:not(:placeholder-shown) {
    border-color: var(--primary-color);
    background: white;
}

/* Button */
.btn {
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span,
.btn i {
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 120, 212, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(108, 117, 125, 0.4);
}

.btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateX(5px);
}

.btn-secondary:hover i {
    transform: translateX(-5px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.3);
}

.btn:disabled::before {
    display: none;
}

/* Security Info */
.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e1e5e9;
}

.security-info i {
    color: var(--primary-color);
    font-size: 16px;
}

/* Footer */
.footer {
    background: rgba(0, 48, 94, 0.95);
    color: white;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content > p {
    margin: 0 0 12px 0;
    opacity: 0.9;
    font-size: 14px;
    font-weight: 500;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    opacity: 0.85;
}

.footer-links span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links .separator {
    opacity: 0.5;
}

.footer-links i {
    font-size: 14px;
}

/* Animações extras */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 0.6s ease-in-out;
}

/* Efeito de foco aprimorado */
*:focus-visible {
    outline: 3px solid rgba(0, 120, 212, 0.5);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Loader para estados de carregamento */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 120px 15px 40px;
    }
    
    .login-card {
        max-width: 100%;
    }
    
    .card-header {
        padding: 20px 30px 18px;
    }
    
    .card-header .logo {
        width: 100px;
        height: 100px;
        margin-bottom: 8px;
        padding: 0;
    }
    
    .icon-wrapper {
        width: 65px;
        height: 65px;
        margin-bottom: 10px;
    }
    
    .icon-wrapper i {
        font-size: 30px;
    }
    
    .card-header h1 {
        font-size: 26px;
        margin-bottom: 5px;
    }
    
    .card-header p {
        font-size: 14px;
    }
    
    .card-body {
        padding: 35px 30px;
    }
    
    .welcome-text h2 {
        font-size: 22px;
    }
    
    .welcome-text p {
        font-size: 14px;
    }
    
    .form-control {
        padding: 14px 18px 14px 48px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 16px;
        font-size: 16px;
    }
    
    .pin-inputs {
        gap: 8px;
    }
    
    .pin-input {
        width: 48px;
        height: 56px;
        font-size: 24px;
    }
    
    .btn {
        padding: 16px 28px;
        font-size: 15px;
    }
    
    .security-info {
        padding: 14px;
        font-size: 12px;
    }
    
    .notification {
        max-width: 95%;
    }
    
    .notification-content {
        padding: 16px 18px;
    }
    
    .notification-icon {
        font-size: 28px;
        margin-right: 14px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-links .separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 110px 12px 30px;
    }
    
    .card-header {
        padding: 18px 25px 16px;
    }
    
    .card-header .logo {
        width: 90px;
        height: 90px;
        margin-bottom: 6px;
        padding: 0;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }
    
    .icon-wrapper i {
        font-size: 26px;
    }
    
    .card-header h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .card-header p {
        font-size: 13px;
    }
    
    .card-body {
        padding: 30px 25px;
    }
    
    .welcome-text h2 {
        font-size: 20px;
    }
    
    .welcome-text p {
        font-size: 13px;
    }
    
    .form-control {
        padding: 13px 16px 13px 46px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 14px;
        font-size: 15px;
    }
    
    .pin-inputs {
        gap: 6px;
    }
    
    .pin-input {
        width: 44px;
        height: 52px;
        font-size: 22px;
    }
    
    .btn {
        padding: 15px 24px;
        font-size: 14px;
    }
    
    .security-info {
        padding: 12px;
        font-size: 11px;
        margin-top: 25px;
    }
    
    .security-info i {
        font-size: 14px;
    }
    
    .footer {
        padding: 25px 15px;
    }
    
    .footer-content > p {
        font-size: 13px;
    }
    
    .footer-links {
        font-size: 12px;
    }
}