* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #004d40;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
}

.login-form {
    background: transparent;
    position: relative;
    z-index: 20;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
}

.header {
    display: flex;
    flex-direction: column;
    margin: 0 0 16px 0;
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    align-items: center;
}

.logo {
    width: 144px;
    max-width: 320px;
}

@media (min-width: 768px) {
    .logo {
        width: 288px;
    }
}

.title {
    text-align: right;
    font-size: 14px;
    color: white;
    font-weight: 600;
    font-style: italic;
}

@media (min-width: 768px) {
    .title {
        font-size: 18px;
    }
}

.form-container {
    display: flex;
    flex-direction: column;
    animation: fadeInDown 0.6s ease-out;
    height: fit-content;
}

.form-content {
    padding: 32px;
    padding-top: 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid white;
    animation: fadeInUp 0.6s ease-out;
}

.input-group {
    margin: 16px 0;
}

.label {
    text-transform: uppercase;
    font-size: 14px;
    color: #4b5563;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    background: #d1d5db;
    color: #111827;
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.input-field:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #e5e7eb;
}

.password-group {
    margin-bottom: 24px;
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: #059669;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.toggle-password:hover {
    color: #374151;
}

.toggle-password svg {
    width: 22px;
    height: 22px;
}

.error-message {
    color: #dc2626;
    font-size: 14px;
    margin-top: 4px;
    min-height: 20px;
}

.error-alert {
    text-align: center;
    margin: 16px 0;
    animation: fadeInUp 0.6s ease-out;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 8px 0 24px 0;
    padding: 12px;
    border: 1px solid #f3f4f6;
    border-left: 4px solid #f97316;
    border-radius: 8px;
    background: white;
}

.warning-icon {
    color: #d97706;
    margin-bottom: 8px;
}

.error-text {
    color: #dc2626;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

.divider {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin: 24px 0;
    width: 100%;
    border-top: 1px solid #e5e7eb;
}

.submit-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn {
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: #10b981;
    color: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.submit-btn:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.submit-btn:active {
    transform: scale(0.9);
}

.submit-btn:disabled {
    cursor: default;
    background: #d1d5db;
    color: #6b7280;
}

.submit-btn:disabled:hover {
    box-shadow: none;
}

.submit-btn:disabled:active {
    transform: none;
}

.links-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: 24px;
}

.reset-link {
    font-size: 14px;
    cursor: pointer;
    color: #064e3b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.reset-link:hover {
    color: #10b981;
}

.alert {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #059669;
}

.dashboard {
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
}

.actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #059669;
}

.btn-logout {
    background: #dc2626;
}

.btn-logout:hover {
    background: #b91c1c;
}

/* Layout com imagem ocupando quase toda a tela */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.image-section {
    width: 100%;
    height: 100vh;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-section {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 400px;
    background: rgba(0, 77, 64, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-section .container {
    width: 100%;
    max-width: none;
}

/* Ajustes para o overlay de loading */
#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

#loading-overlay p {
    margin-top: 20px;
    font-size: 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos específicos para a página de verificação */
.verification-section {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 450px;
    background: rgba(0, 77, 64, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.verification-info {
    background: rgba(17, 24, 39, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.verification-info h3 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.verification-info p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.input-row {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.input-group-half {
    flex: 1;
}

.btn-resend {
    background: transparent;
    border: 1px solid #10b981;
    color: #10b981;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-resend:hover {
    background: #10b981;
    color: white;
}

.btn-resend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tela de aguarde para verificação */
.waiting-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.waiting-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.waiting-animation {
    margin-bottom: 30px;
}

.waiting-title {
    color: #1e40af;
    font-size: 24px;
    margin-bottom: 25px;
    font-weight: 600;
}

.waiting-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.waiting-info p {
    margin-bottom: 15px;
    font-weight: 600;
    color: #374151;
}

.waiting-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.waiting-info li {
    padding: 8px 0;
    color: #059669;
    font-weight: 500;
}

.waiting-message {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.waiting-message p {
    margin-bottom: 10px;
    color: #1e40af;
}

.refresh-note {
    font-size: 14px;
    color: #6b7280 !important;
    font-style: italic;
}

.back-link {
    margin-top: 20px;
}

/* Tela de ativação do dispositivo */
.activation-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.activation-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    text-align: center;
}

.activation-icon {
    margin-bottom: 20px;
}

.device-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.activation-message h2 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.main-message {
    color: #374151;
    font-size: 14px;
    margin-bottom: 12px;
}

.instruction {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 18px;
}

.security-steps {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 3px solid #10b981;
    transition: all 0.3s ease;
    text-align: left;
}

.step:hover {
    background: #f1f5f9;
    transform: translateX(3px);
}

.step-number {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.step-content p {
    color: #6b7280;
    font-size: 12px;
    margin: 0;
    line-height: 1.3;
}

.security-note {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 18px 0;
}

.security-note p {
    margin: 0;
    color: #92400e;
    font-size: 13px;
    line-height: 1.4;
}

.button-container {
    margin: 20px 0 10px 0;
}

.continue-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.continue-btn:active {
    transform: translateY(0);
}

/* Ajustes responsivos específicos para ativação */
@media (max-width: 1200px) {
    .verification-section {
        width: 420px;
    }
    
    .activation-content {
        padding: 20px 15px;
    }
    
    .step {
        padding: 10px 12px;
    }
    
    .step-content strong {
        font-size: 13px;
    }
    
    .step-content p {
        font-size: 11px;
    }
}

@media (max-width: 1024px) {
    .verification-section {
        width: 400px;
    }
    
    .activation-content {
        padding: 18px 12px;
    }
    
    .activation-message h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .main-message {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .instruction {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .security-steps {
        margin: 15px 0;
        gap: 10px;
    }
    
    .step {
        padding: 8px 10px;
    }
    
    .step-number {
        width: 26px;
        height: 26px;
        font-size: 13px;
        margin-right: 10px;
    }
    
    .step-content strong {
        font-size: 12px;
    }
    
    .step-content p {
        font-size: 10px;
    }
    
    .security-note {
        padding: 12px;
        margin: 15px 0;
    }
    
    .security-note p {
        font-size: 12px;
    }
    
    .continue-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 900px) {
    .verification-section {
        width: 380px;
    }
    
    .activation-content {
        padding: 15px 10px;
    }
    
    .activation-message h2 {
        font-size: 15px;
    }
    
    .security-steps {
        gap: 8px;
    }
    
    .step {
        padding: 6px 8px;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-right: 8px;
    }
    
    .step-content strong {
        font-size: 11px;
    }
    
    .step-content p {
        font-size: 9px;
    }
}

/* Remove scroll e ajusta altura automaticamente */
.verification-section {
    max-height: none;
    overflow: visible;
}

/* Animações simplificadas */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step {
    animation: slideInRight 0.4s ease-out;
    animation-fill-mode: both;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

/* Estilos para tela de sucesso */
.success-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    animation: slideInUp 0.6s ease-out;
}

.success-content {
    padding: 40px 30px;
}

.success-animation {
    margin-bottom: 30px;
}

.checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.checkmark-svg {
    width: 80px;
    height: 80px;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #10b981;
    stroke-width: 3;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.success-title {
    color: #10b981;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
}

.user-info {
    background: rgba(16, 185, 129, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #10b981;
}

.user-info p {
    margin: 8px 0;
    font-size: 16px;
    color: #374151;
}

.credentials-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(16, 185, 129, 0.3);
}

.credentials-summary p {
    margin: 5px 0;
    font-size: 14px;
    color: #059669;
}

.device-authorized {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.device-authorized h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.device-authorized p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.redirect-info {
    background: rgba(59, 130, 246, 0.1);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
}

.countdown {
    margin-bottom: 15px;
}

.countdown p {
    font-size: 16px;
    color: #3b82f6;
    font-weight: 600;
}

#countdown {
    font-size: 20px;
    font-weight: bold;
    color: #1d4ed8;
}

.btn-redirect {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-redirect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* Animação de entrada para tela de sucesso */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade para tela de sucesso */
@media (max-width: 1200px) {
    .success-content {
        padding: 30px 25px;
    }
    
    .success-title {
        font-size: 24px;
    }
    
    .device-authorized h3 {
        font-size: 18px;
    }
}

@media (max-width: 1024px) {
    .success-content {
        padding: 25px 20px;
    }
    
    .success-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .user-info {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .user-info p {
        font-size: 15px;
    }
    
    .credentials-summary p {
        font-size: 13px;
    }
    
    .device-authorized {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .device-authorized h3 {
        font-size: 17px;
    }
    
    .device-authorized p {
        font-size: 15px;
    }
    
    .redirect-info {
        padding: 15px;
    }
    
    .countdown p {
        font-size: 15px;
    }
    
    #countdown {
        font-size: 18px;
    }
    
    .btn-redirect {
        padding: 10px 25px;
        font-size: 15px;
    }
}

@media (max-width: 900px) {
    .success-content {
        padding: 20px 15px;
    }
    
    .success-title {
        font-size: 20px;
    }
    
    .checkmark {
        width: 60px;
        height: 60px;
    }
    
    .checkmark-svg {
        width: 60px;
        height: 60px;
    }
    
    .device-authorized h3 {
        font-size: 16px;
    }
    
    .device-authorized p {
        font-size: 14px;
    }
}

/* Estilos específicos para mobile - remove imagem e ajusta layout */
@media (max-width: 768px) {
    .main-container {
        background: #004d40 !important; /* Fundo verde direto */
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
    
    /* Remove a imagem completamente no mobile */
    .image-section {
        display: none !important;
    }
    
    /* Ajusta a seção de login para ocupar toda a tela */
    .login-section {
        position: static !important;
        width: 100% !important;
        max-width: 400px;
        margin: 0 auto;
        background: rgba(0, 77, 64, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        bottom: auto !important;
        right: auto !important;
    }
    
    .verification-section {
        position: static !important;
        width: 100% !important;
        max-width: 400px;
        margin: 0 auto;
        background: rgba(0, 77, 64, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        bottom: auto !important;
        right: auto !important;
    }
    
    /* Ajustes do formulário para mobile */
    .form-content {
        padding: 25px 20px;
    }
    
    .logo {
        width: 120px;
    }
    
    .title {
        font-size: 16px;
    }
    
    .input-field {
        padding: 14px 12px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .submit-btn {
        padding: 14px 12px;
        font-size: 16px;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-section,
    .verification-section {
        padding: 15px;
        border-radius: 12px;
    }
    
    .form-content {
        padding: 20px 15px;
    }
    
    .logo {
        width: 100px;
    }
    
    .title {
        font-size: 14px;
    }
    
    .input-field {
        padding: 12px 10px;
    }
    
    .submit-btn {
        padding: 12px 10px;
    }
}

/* Landscape em celulares pequenos */
@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        padding: 15px;
    }
    
    .form-content {
        padding: 20px 15px;
    }
    
    .logo {
        width: 100px;
    }
}

/* Tablets em portrait */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-section,
    .verification-section {
        width: 400px;
        bottom: 30px;
        right: 30px;
    }
}

/* Ajustes para iPhone pequenos */
@media (max-width: 375px) {
    .form-content {
        padding: 15px 10px;
    }
    
    .input-group {
        margin: 12px 0;
    }
    
    .logo {
        width: 90px;
    }
    
    .title {
        font-size: 12px;
    }
}